Hello list, Asterisk 1.6.16.1 I have the following registrations : register => 119909:passwd at sip.prov.org/52525252 register => 119909:passwd at sip.prov.org/59595959 [119909] type=friend host=sip.prov.org username=119909 defaultuser=119909 secret=passwd context=TRUNKin extensions.conf : [TRUNKin] exten => _52525252,1,NoOp(context TRUNKin - 52525252) exten => _52525252,n,GoTo(blabla,52525252,1) exten => _59595959,1,NoOp(context TRUNKin - 59595959) exten => _59595959,n,GoTo(blablabla,59595959,1) Problem : the call always enters : exten => _52525252 and never : exten => _59595959 Why is that ?? Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110120/a0f46e15/attachment.htm>
_____ From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens Sent: Thursday, January 20, 2011 9:20 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] context problem Hello list, Asterisk 1.6.16.1 I have the following registrations : register => 119909:passwd at sip.prov.org/52525252 register => 119909:passwd at sip.prov.org/59595959 [119909] type=friend host=sip.prov.org username=119909 defaultuser=119909 secret=passwd context=TRUNKin extensions.conf : [TRUNKin] exten => _52525252,1,NoOp(context TRUNKin - 52525252) exten => _52525252,n,GoTo(blabla,52525252,1) exten => _59595959,1,NoOp(context TRUNKin - 59595959) exten => _59595959,n,GoTo(blablabla,59595959,1) Problem : the call always enters : exten => _52525252 and never : exten => _59595959 Why is that ?? Kind regards, Jonas. Because this an incoming call. What you are trying to accomplish should be done via "ex-girlfriend" logic. The way your dialplan is set up, it assumes you are "dialing" 525225252 or 59595959 instead of receiving a call. Here is how the incoming should read [TRUNKin] - exten => s,1,answer - exten => s/52525252,n,Goto(blabla,52525252,1) - exten => s/59595959,n,Goto(blabla,59595959,1) - exten => s,n,verbose(call is not from 5252 or 5959) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110120/d610678b/attachment.htm>
On 01/20/2011 04:29 PM, Danny Nicholas wrote:> ------------------------------------------------------------------------ > > *From:* asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] *On Behalf Of *Jonas > Kellens > *Sent:* Thursday, January 20, 2011 9:20 AM > *To:* Asterisk Users Mailing List - Non-Commercial Discussion > *Subject:* [asterisk-users] context problem > > Hello list, > > Asterisk 1.6.16.1 > > I have the following registrations : > > register => 119909:passwd at sip.prov.org/52525252 > <mailto:119909:passwd at sip.prov.org/52525252> > register => 119909:passwd at sip.prov.org/59595959 > <mailto:119909:passwd at sip.prov.org/59595959> > > [119909] > type=friend > host=sip.prov.org > username=119909 > defaultuser=119909 > secret=passwd > context=TRUNKin > > extensions.conf : > > [TRUNKin] > exten => _52525252,1,NoOp(context TRUNKin - 52525252) > exten => _52525252,n,GoTo(blabla,52525252,1) > > exten => _59595959,1,NoOp(context TRUNKin - 59595959) > exten => _59595959,n,GoTo(blablabla,59595959,1) > > > Problem : > > the call always enters : exten => _52525252 > > and never : exten => _59595959 > > Why is that ?? > > > Kind regards, > Jonas. > > Because this an incoming call. What you are trying to accomplish > should be done via "ex-girlfriend" logic. The way your dialplan is > set up, it assumes you are "dialing" 525225252 or 59595959 instead of > receiving a call. Here is how the incoming should read > > [TRUNKin] > > - exten => s,1,answer > > - exten => s/52525252,n,Goto(blabla,52525252,1) > > - exten => s/59595959,n,Goto(blabla,59595959,1) > > - exten => s,n,verbose(call is not from 5252 or 5959) >Hello, when I leave out the /52525252 and /59595959 in the registration, indeed the call enters the s-extension in my context. I will try your suggestion... Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110120/474d3720/attachment.htm>
Jonas Kellens wrote: [snip]> > register => 119909:passwd at sip.prov.org/52525252 > register => 119909:passwd at sip.prov.org/59595959 > > [TRUNKin] > exten => _52525252,1,NoOp(context TRUNKin - 52525252) > exten => _52525252,n,GoTo(blabla,52525252,1) > > exten => _59595959,1,NoOp(context TRUNKin - 59595959) > exten => _59595959,n,GoTo(blablabla,59595959,1) > > > Problem : > > the call always enters : exten => _52525252 > > and never : exten => _59595959 > > Why is that ??Could you try removing the leading '_', as you seem to be expecting the exact number? Try that and let us know. Regards, -- Jose P. Espinal http://www.eSlackware.com IRC: Khratos @ #asterisk / -doc / -bugs
I always thought the last bit (after the /) is where the context in sip.conf landed. What about: (sip.conf) register => 119909:passwd at sip.prov.org/52525252 register => 119909:passwd at sip.prov.org/59595959 [52525252] ... context = TRUNKin52 ... [59595959] ... context = TRUNKin59 ... And split them out in extensions.conf? I have a suspicion that you have 'context=TRUNKin' under the '[default]' section of sip.conf - which is why they are hitting there in the first place. Then again, I have been known to be wrong ;) -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens Sent: 20 January 2011 16:39 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] context problem On 01/20/2011 05:23 PM, Jeroen Eeuwes wrote:> Hi Jonas, > > >> What else can I try ? >> > Yeah, Asterisk always assumes that from 1 ip address there can only be> inbound number. Not very user-friendly. > > I think I've used something like this: > > exten => s,1,Set(CALL-TO=${SIP_HEADER(TO)}) > exten => s,n,Set(CALL-FROM=${CALLERIDNUM}) > exten => s,n,GotoIf($["${CALL-TO}" : > ".*52525252.*"]?TRUNKin,52525252,1) > exten => s,n,GotoIf($["${CALL-TO}" :".*59595959.*"]?TRUNKin,59595959,1)> exten => s,n,etcetera > > Best regards, > Jeroen Eeuwes > > --Hello, this is the result when using your config : [Jan 20 17:33:50] -- Executing [s at TRUNKin:1] NoOp("SIP/119909-000006d7", "context TRUNKin - s") in new stack [Jan 20 17:33:50] -- Executing [s at TRUNKin:2] NoOp("SIP/119909-000006d7", ""775006" <775006>") in new stack [Jan 20 17:33:50] -- Executing [s at TRUNKin:3] NoOp("SIP/119909-000006d7", ""775006" <775006>") in new stack [Jan 20 17:33:50] -- Executing [s at TRUNKin:4] NoOp("SIP/119909-000006d7", "<sip:s at 11.11.12.112>") in new stack [Jan 20 17:33:50] -- Executing [s at TRUNKin:5] NoOp("SIP/119909-000006d7", "") in new stack [Jan 20 17:33:50] -- Executing [s at TRUNKin:6] NoOp("SIP/119909-000006d7", "775006") in new stack dialplan : exten => s,1,NoOp(context TRUNKin - s) exten => s,n,NoOp(${CALLERID(all)}) exten => s,n,NoOp(${CALLERID(all)}) exten => s,n,NoOp(${SIP_HEADER(TO)}) exten => s,n,NoOp(${CALLERIDNUM}) exten => s,n,NoOp(${CALLERID(num)}) Kind regards, Jonas. -- _____________________________________________________________________ -- 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 If you have received this communication in error we would appreciate you advising us either by telephone or return of e-mail. The contents of this message, and any attachments, are the property of DataVox, and are intended for the confidential use of the named recipient only. If you are not the intended recipient, employee or agent responsible for delivery of this message to the intended recipient, take note that any dissemination, distribution or copying of this communication and its attachments is strictly prohibited, and may be subject to civil or criminal action for which you may be liable. Every effort has been made to ensure that this e-mail or any attachments are free from viruses. While the company has taken every reasonable precaution to minimise this risk, neither company, nor the sender can accept liability for any damage which you sustain as a result of viruses. It is recommended that you should carry out your own virus checks before opening any attachments. Registered in England. No. 27459085.
> I may be wrong here, but I think you can only register once. The last > registration received will overwrite the first one. You will need to > specify a second entry and register that one separately. This is the > same reason you cannot register two devices to the same extension.Yes, that's very likely what is happening. The provider is seeing two SIP registrations arrive, for the same provider account, from the same peer at the same IP address. It is very likely that the second registration is (by design) replacing the first. Then, whenever someone dials a DID associated with this provider account, the provider is routing the call based on the information in the most current registration... it's either going to the context and extension specified in that registration (if their is one) or to the "s" extension for the relevant context. (Some providers do allow multiple registration for a given account, and will INVITE all of them when an incoming call arrives, but (if I recall correctly) the registrations have to come from different IP addresses (and perhaps different peers) in order to be recognized as being distinct.) There are probably several ways around this: (1) Use two different provider accounts, and associate each DID with a different account. Use two "register" statements, one per account, and specify different routing extensions on these. (2) Use a provider which will let you register once, and will "pass through" the DID number which was dialed as the target extension. (3) Use a provider which will let you set up your DIDs for hardwired-IP-address routing (i.e. no "register" being required) and who passes through the DID as the extension to be called. I recently set up an account with Vitelity, and they support option (3). I simply entered the public IP address of my SIP server for the routing, and everything works correctly... the incoming INVITE requests say "sip:MYDID at MYIPADDRESS". Asterisk then uses "MYDID" as the desired extension in my dialplan, and routes the call appropriately. I'd suggest that the OP ask the current SIP provider whether they handle (2) i.e. whether it's possible for different DIDs associated with a single account to have different information in the INVITE requests sent to the registered client.