Trey Hilyard
2016-Mar-18 15:58 UTC
[asterisk-users] Incoming INVITE with Portability Info and LRN
On Fri, Mar 18, 2016 at 10:49 AM Administrator TOOTAI <admin at tootai.net> wrote:> Le 18/03/2016 16:20, Trey Hilyard a ?crit : > > I am trying to set up my Asterisk server so that it will recognize an > > incoming call to the Asterisk's own Location Routing Number (LRN), > > validating the "rn" in the INVITE and then using the Called Number from > > the INVITE as the extension in the dialplan. > > > > The INVITE R-URI looks like: > > INVITE > > sip:+19135041291;rn=+19136630000;npdi at 12.4.240.200 > :5060;user=phone;transport=udp > > SIP/2.0 > > > > The +1913663000 is the LRN of the Asterisk box, so I would want to have > > the dialplan validate that the "rn" is that number. The +19136631291 is > > the extension within the system that they are trying to reach, that > > extension will vary, and will have an exten defined in the dialplan. > > > > I assume that this is just going to require that I do some matching and > > substring-type variable replacement to hit a context with just the > > Called Number part of the request, but I wondered if anyone had a > > working example of this before I started putting too much effort into it. > > Use the SIP_HEADER function > > http://www.voip-info.org/wiki/view/Asterisk+func+sip_headerI am not sure that this is needed here. The Request URI has all of the values that I need. I agree that I might need to CUT part of the R-URI, but I don't need access to any other header to find the info I need. When the call arrives at the Asterisk right now, this is the exten/context that it is hitting, so it already has the info I need: Executing [9135041291;rn=+19136630000;npdi at from_pstn:1] As far as I can tell, I think that I just need to figure out how to make an extension entry that matches on the "rn=+19136630000\;npdi" and then moves to another context (or same one) with ${EXTEN,0,10}. I just can't get that first extension to match on the RN value.> > > -- > Daniel > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160318/c03fdb13/attachment.html>
Trey Hilyard
2016-Mar-18 20:19 UTC
[asterisk-users] Incoming INVITE with Portability Info and LRN
I thought this would be as easy as exten => _XXXXXXXXXX\;rn=+19136630000,1,Goto(from_pstn,${EXTEN:0:10}) But it appears that the pattern match doesn't work once I get to the "r" in "rn". I am assuming that the pattern match doesn't like dealing with characters without taking the entire URI. I am working on a plan using a lot more CUTs than I think I should need, but we'll see if it works. On Fri, Mar 18, 2016 at 10:58 AM Trey Hilyard <kctrey at gmail.com> wrote:> On Fri, Mar 18, 2016 at 10:49 AM Administrator TOOTAI <admin at tootai.net> > wrote: > >> Le 18/03/2016 16:20, Trey Hilyard a ?crit : >> > I am trying to set up my Asterisk server so that it will recognize an >> > incoming call to the Asterisk's own Location Routing Number (LRN), >> > validating the "rn" in the INVITE and then using the Called Number from >> > the INVITE as the extension in the dialplan. >> > >> > The INVITE R-URI looks like: >> > INVITE >> > sip:+19135041291;rn=+19136630000;npdi at 12.4.240.200 >> :5060;user=phone;transport=udp >> > SIP/2.0 >> > >> > The +1913663000 is the LRN of the Asterisk box, so I would want to have >> > the dialplan validate that the "rn" is that number. The +19136631291 is >> > the extension within the system that they are trying to reach, that >> > extension will vary, and will have an exten defined in the dialplan. >> > >> > I assume that this is just going to require that I do some matching and >> > substring-type variable replacement to hit a context with just the >> > Called Number part of the request, but I wondered if anyone had a >> > working example of this before I started putting too much effort into >> it. >> >> Use the SIP_HEADER function >> >> http://www.voip-info.org/wiki/view/Asterisk+func+sip_header > > > I am not sure that this is needed here. The Request URI has all of the > values that I need. I agree that I might need to CUT part of the R-URI, but > I don't need access to any other header to find the info I need. > > When the call arrives at the Asterisk right now, this is the exten/context > that it is hitting, so it already has the info I need: > Executing [9135041291;rn=+19136630000;npdi at from_pstn:1] > > As far as I can tell, I think that I just need to figure out how to make > an extension entry that matches on the "rn=+19136630000\;npdi" and then > moves to another context (or same one) with ${EXTEN,0,10}. > > I just can't get that first extension to match on the RN value. > > > >> >> >> -- >> Daniel >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> New to Asterisk? Join us for a live introductory webinar every Thurs: >> http://www.asterisk.org/hello >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160318/5ba9ab66/attachment.html>
Steve Edwards
2016-Mar-18 20:35 UTC
[asterisk-users] Incoming INVITE with Portability Info and LRN
On Fri, 18 Mar 2016, Trey Hilyard wrote:> I thought this would be as easy as > exten => _XXXXXXXXXX\;rn=+19136630000,1,Goto(from_pstn,${EXTEN:0:10})Have you tried the '_!.' pattern? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST https://www.linkedin.com/in/steve-edwards-4244281