[SR-Users] kamailio + dispatcher asterisks + pstn gateways

Aidar Kamalov aidar.kamalov at gmail.com
Tue Aug 8 18:38:03 CEST 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20170808/fe8b77c8/attachment.html>


More information about the sr-users mailing list