JR Richardson
2006-Dec-05 11:50 UTC
[asterisk-users] regcontext, NoOp extension vanishes when extension reload and doesn't come back
Hi All, I just noticed something interesting. When a sip device registers and regcontext is setup in sip.conf, a NoOp priority 1 extension is dynamically created in the dialplan within the specified regcontext. Works great. If for some reason, modification is made to the extension.conf and a >reload extension is performed, those dynamically created extensions in the regcontext vanish. Now this is ok, I understand why they vanish, but the strange thing is they don't come back when the sip device registration time expires. If I set the max regiter time of the device to be 60 seconds, after 60 seconds the phone sends another registration to the server, but since the user is already cached in, the NoOp priority 1 extension does not get re-created in the regcontext. I must perform a >reload chan_sip.so, wait till the new registration hits and then the NoOp priority 1 extension is created again in the regcontext. This is a problem, if anything happens to the dialplan and it has to be reloaded, we loose active registered sip devices in the regcontext, then all hell breaks loose. Has anyone else come across this and has a work around? Ultimately, I'd like to see the regcontext function ensure the NoOp priority 1 extension is re-newed each registration cycle, whatever the time parameter is set on. Thanks. JR -- JR Richardson Engineering for the Masses
Watkins, Bradley
2006-Dec-05 11:59 UTC
[asterisk-users] regcontext, NoOp extension vanishes when extension reload and doesn't come back
Let me guess: The context in which you have the 2 thru n priorities is the same one as you're using for regcontext right? Don't do that, bad things will happen (as you've noticed). I'd have to review the code again, but I think what you're seeing is as a result of this. Regards, - Brad> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > JR Richardson > Sent: Tuesday, December 05, 2006 1:50 PM > To: asterisk-users@lists.digium.com > Subject: [asterisk-users] regcontext,NoOp extension vanishes > when extension reload and doesn't come back > > Hi All, > > I just noticed something interesting. When a sip device > registers and regcontext is setup in sip.conf, a NoOp > priority 1 extension is dynamically created in the dialplan > within the specified regcontext. > Works great. If for some reason, modification is made to the > extension.conf and a >reload extension is performed, those > dynamically created extensions in the regcontext vanish. Now > this is ok, I understand why they vanish, but the strange > thing is they don't come back when the sip device > registration time expires. > > If I set the max regiter time of the device to be 60 seconds, > after 60 seconds the phone sends another registration to the > server, but since the user is already cached in, the NoOp > priority 1 extension does not get re-created in the > regcontext. I must perform a >reload chan_sip.so, wait till > the new registration hits and then the NoOp priority 1 > extension is created again in the regcontext. > > This is a problem, if anything happens to the dialplan and it > has to be reloaded, we loose active registered sip devices in > the regcontext, then all hell breaks loose. > > Has anyone else come across this and has a work around? > Ultimately, I'd like to see the regcontext function ensure > the NoOp priority 1 extension is re-newed each registration > cycle, whatever the time parameter is set on. > > Thanks. > > JR > -- > JR Richardson > Engineering for the Masses > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
Watkins, Bradley
2006-Dec-05 13:59 UTC
[asterisk-users] regcontext, NoOp extension vanishes when extension reload and doesn't come back
> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > Michiel van Baak > Sent: Tuesday, December 05, 2006 2:09 PM > To: asterisk-users@lists.digium.com > Subject: Re: [asterisk-users] regcontext,NoOp extension > vanishes when extension reload and doesn't come back > > On 13:59, Tue 05 Dec 06, Watkins, Bradley wrote: > > Let me guess: The context in which you have the 2 thru n > priorities > > is the same one as you're using for regcontext right? > > > > Don't do that, bad things will happen (as you've noticed). > > > > I'd have to review the code again, but I think what you're > seeing is > > as a result of this. > > Then how should it be done ? > I'm playing with this as well and now I'm back to 0. I just > had it all working on paper... >You should put all of the 2 thru n priorities in a separate context and then include the regcontext into that. For example: Let's say regcontext = registrations And you have a SIP peer: [1234] type=peer ... regexten=1234 You actual dialplan context should look something like: [extensions] exten => _1XXX,2,Dial(SIP/${EXTEN}) exten => _1XXX,3,Hangup Include => registrations Now, when peer 1234 registers, the registrations context will look like: [ Context 'registrations' created by 'SIP' ] '1234' => 1. NoOp() [SIP] And, since the 'extensions' context includes 'registrations', any calls that originate in 'extensions' will succeeed where they will not if 1234 is not registered. Regards, - Brad The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.