kamailio + dispatcher asterisks + pstn gateways

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

kamailio + dispatcher asterisks + pstn gateways

Aidar Kamalov
Hello,

Whats the best way to provide subject?
Now I have central kamailio server and (asterisk "media" servers + asterisk pstn gateway in different cities). 
Kamailio default config with some changes in route[LOCATION]
        if (!lookup("location")) {
                $var(rc) = $rc;
                route(TOVOICEMAIL);

                t_newtran();
                switch ($var(rc)) {
                        case -1:
                                xwarn("Contact $rU not registered. Forwarding call to dispatcher");
                                append_hf("X-External: true\r\n");
                                $rU = "00"+$rU;
                                break;
                        case -3:
                                send_reply("404", "Not Found");
                                exit;
                        case -2:
                                send_reply("405", "Method Not Allowed");
                                exit;
                }
        }
......
        # when routing via usrloc, log the missed calls also
        if (is_method("INVITE")) {
                setflag(FLT_ACCMISSED);
        }
                
        if(!ds_is_from_list()) {
            route(DISPATCH);
        }
        route(RELAY);

So all calls going to asterisk server. Not local calls with 00 prefix.
And asterisk context:
context kamailio {                                                    
    _X. => {                                                          
        Noop(CALL to kamailio user ${EXTEN});                         
        Dial(SIP/${EXTEN}@${SIPDOMAIN},60,RTt);
        Hangup;
    }

    _00X. => {
        Noop(CALL to external user ${EXTEN});
        Dial(SIP/PSTN-SERVER/${EXTEN:2},60,RTt);
        Hangup;
    }
}

Is it right way? Maybe any better approach? How to keep route logic at kamailio, but use dispatcher asterisk to proccess the calls to pstn(all endpoints at one city to pstn asterisk at this city. In others city there are other pstn gateways)?
--
Aydar A. Kamalov

_______________________________________________
Kamailio (SER) - Users Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Loading...