On Fri, Aug 11, 2017 at 01:29:18PM +0300, vs@cell.tel wrote:
There is nothing special about this scenario, asterisk is an enduser for kamailio. Have it register to kamailio and use for example the alias_db module to send 7XXX numbers to the registered asterisk user. All this is in the supplied example config kamailio-advanced.cfg.
On Sat, Aug 12, 2017 at 08:49:45AM +0300, vs@cell.tel wrote:
... asterisk conf ...
Alternative is to first do the lookup in kamailio and then restore the $rU variable:
$var(orgRu)=$rU; if lookup()/alias_db_lookup success $rU=$var(orgRu);
A way to do this is by storing prefixex in the aliasdb table. I use this brilliant piece of code to match exact numers, 10 number blocks, 100 and 1000 number blocks.
if(!alias_db_lookup("dbaliases")) { strip_tail(1);
if(!alias_db_lookup("dbaliases")) { strip_tail(1); if(!alias_db_lookup("dbaliases")) { strip_tail(1); alias_db_lookup("dbaliases"); } } }
Since my dbaliases contains full e164 number/prefixes there are no collisions. Adapt for your number schemes.
An alternative is to use sqlops to do custom queries and for example retrieve the username and use lookup() to route.
Yes, it requires a very particular configuration. With asterisk you in sip.conf you need
externaddr=you.public.ip
This is used in SIP registrations by Asterisk. You should also be comfortable with debugging the SIP traffic to make sure all IP's are set properly. For asterisk:
sip set debug on
Look for REGISTER messages.
Another amazing tool for this is sipgrep ( https://github.com/sipcapture/sipgrep). It's like ngrep but for SIP.
Benjamin Fitzgerald LETS Corporation (925) 566-5600 ext. 25 ben@letscorp.us
*******Confidential Notice: This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please delete this message from all computers and contact Orion Systems/LETS Corp immediately by return e-mail and/or telephone at (925) 566-5600
On Fri, Aug 11, 2017 at 3:29 AM, vs@cell.tel wrote:
On Fri, Aug 11, 2017 at 09:35:45AM -0700, Benjamin Fitzgerald wrote:
Another amazing tool for this is sipgrep ( https://github.com/sipcapture/sipgrep). It's like ngrep but for SIP.
And here I thought sngrep was the ngrep for SIP :)