<div dir="ltr">Hello,<div><br></div><div>Whats the best way to provide subject?</div><div>Now I have central kamailio server and (asterisk "media" servers + asterisk pstn gateway in different cities). </div><div>Kamailio default config with some changes in route[LOCATION]</div><div><div><div>        if (!lookup("location")) {</div><div>                $var(rc) = $rc;</div><div>                route(TOVOICEMAIL);</div><div><br></div><div>                t_newtran();</div><div>                switch ($var(rc)) {</div><div>                        case -1:</div><div>                                xwarn("Contact $rU not registered. Forwarding call to dispatcher");</div><div>                                append_hf("X-External: true\r\n");</div><div>                                $rU = "00"+$rU;</div><div>                                break;</div><div>                        case -3:</div><div>                                send_reply("404", "Not Found");</div><div>                                exit;</div><div>                        case -2:</div><div>                                send_reply("405", "Method Not Allowed");</div><div>                                exit;</div><div>                }</div><div>        }</div></div><div>......</div><div><div>        # when routing via usrloc, log the missed calls also</div><div>        if (is_method("INVITE")) {</div><div>                setflag(FLT_ACCMISSED);</div><div>        }</div><div>                </div><div>        if(!ds_is_from_list()) {</div><div>            route(DISPATCH);</div><div>        }</div><div>        route(RELAY);</div></div><div><br></div><div>So all calls going to asterisk server. Not local calls with 00 prefix.</div><div>And asterisk context:</div><div><div>context kamailio {                                                    </div><div>    _X. => {                                                          </div><div>        Noop(CALL to kamailio user ${EXTEN});                         </div><div>        Dial(SIP/${EXTEN}@${SIPDOMAIN},60,RTt);</div><div>        Hangup;</div><div>    }</div><div><br></div><div>    _00X. => {</div><div>        Noop(CALL to external user ${EXTEN});</div><div>        Dial(SIP/PSTN-SERVER/${EXTEN:2},60,RTt);<br></div><div>        Hangup;</div><div>    }</div><div>}</div></div><div><br></div><div>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)?</div>-- <br><div class="gmail_signature">Aydar A. Kamalov</div>
</div></div>