You have two options for dealing with an IP change during the registration period: 1) set the registration time to shorter period of time to minimize the downtime 2) detect that the IP address has changed via whatever method available, and then issue a "sip reload" CLI command to asterisk, which will cause it to resend registrations immediately. On Tue, Mar 31, 2015 at 1:36 PM, Daniel Heckl <daniel.heckl at gmail.com> wrote:> Maybe someone could elaborate on my first question again. > > If the ip address changes while a REGISTER period, the ip address of the > peer isn't been updated. How can asterisk update the ip address of the peer? > > Am 31.03.2015 um 12:36 schrieb Daniel Heckl <daniel.heckl at gmail.com>: > > Hello Sebastian, > > I had already seen this list of the hosts, but it is not active. All > servers with which my Asterisk has been communicated are not listed. > > A port scan, to eventually update the list, found hundreds of servers > provided in the address range 217.0.0.0/13 with open port 5060, some were > even not found. I think there must be another solution. > > If I change insecure to insecure=port,invite - could that be a solution? > > Or should I try to change to res_pjsip (upgrade to Asterisk 13 is no > problem)? Has there anyone experience with dynamic ip addresses of Asterisk? > > Daniel > > Am 30.03.2015 um 20:09 schrieb Sebastian Kemper <sebastian_ml at gmx.net>: > > On Mon, Mar 30, 2015 at 06:31:46PM +0200, Daniel Heckl wrote: > > Hello > > I use Asterisk 11 with FreePBX 12. Our SIP Provider is Telekom > Germany. We have sometimes problems with incoming and outgoing calls. > I hope I can explain it understandable. > > > Hello Daniel, > > I'll find myself in the same situation a few weeks from now :-) > > > For example, Asterisk sends a REGISTER to 217.0.23.68 (tel.t-online.de > <http://tel.t-online.de/>), the message is answered with OK and the > peer is registered. > > Usually INVITES comes now from this ip address. All works fine. But > sometimes INVITES comes from an other IP address, for example > 217.0.23.100. This request Asterisk responds with 401 Unauthorized. > > In the next register procedure REGISTER are sent to the new ip address > and answered also with OK. But qualify OPTIONS are continue be sent to > the old ip address. Incoming and outgoing calls are canceled. Outgoing > calls are answered with Forbidden. > > Even if the REGISTER procedure works with the new ip address, the > peers are connected with the old address. > > Waiting doesn?t help, only a ?sip reload? update the ip address of the > peer. > > What is the solution for this problem? How can asterisk update the > peer? > > > I think the solution - for the inbound issue at least - could be to add > more hosts as a peer. Have a looks at this forum post: > > > http://www.ip-phone-forum.de/showthread.php?t=268787&p=1999371&viewfull=1#post1999371 > > The user used a template and than he added peers, each with its own IP > address. The provided list was last updated in 2014, though, so I assume > the provider in the meantime has added to that list. > > It looks pretty tedious, though, I mean there could be dozens of IPs > you'd have to add. But I guess this is the way to go with Asterisk 11 > and chan_sip. > > The future looks brighter :-) I read that with pjsip, which I understand > is the replacement for chan_sip, you can have one peer entry and match > an IP range instead of a single host. That should tidy up the dialplan. > > What I'm a little afraid of is the SIP provider using IPs out of a range > that they also use for other services. Maybe out of the same range they > hand out IPs to their customers. I guess we got to be careful :-) > > Kind regards, > Sebastian > > The Asterisk is local behind a NAT with a firewall, following settings > are used: > > externhost with DynDNS stun with stun.t-online.de > <http://stun.t-online.de/> nat=yes srvlookup=yes allowguest=no > trustrpid=no insecure=invite qualify=yes > > Thank you! 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 > > > > -- > _____________________________________________________________________ > -- 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 > > > > -- > _____________________________________________________________________ > -- 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 >-- [image: Digium logo] Scott Griepentrog Digium, Inc ? Software Developer 445 Jan Davis Drive NW ? Huntsville, AL 35806 ? US direct/fax: +1 256 428 6239 ? mobile: +1 256 580 6090 Check us out at: http://digium.com ? http://asterisk.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150331/0f9a75ec/attachment.html>
Scott, thank you four your reply. I had already though about both options, but the problem is, that after an ip change AND a new registration the ip address of the peer is not updated automatically. INVITES are answered with 401. Only after a sip reload the peer works again. That can't be normal... Daniel> Am 31.03.2015 um 22:45 schrieb Scott Griepentrog <sgriepentrog at digium.com>: > > You have two options for dealing with an IP change during the registration period: > > 1) set the registration time to shorter period of time to minimize the downtime > > 2) detect that the IP address has changed via whatever method available, and then issue a "sip reload" CLI command to asterisk, which will cause it to resend registrations immediately. > >> On Tue, Mar 31, 2015 at 1:36 PM, Daniel Heckl <daniel.heckl at gmail.com> wrote: >> Maybe someone could elaborate on my first question again. >> >> If the ip address changes while a REGISTER period, the ip address of the peer isn't been updated. How can asterisk update the ip address of the peer? >> >>> Am 31.03.2015 um 12:36 schrieb Daniel Heckl <daniel.heckl at gmail.com>: >>> >>> Hello Sebastian, >>> >>> I had already seen this list of the hosts, but it is not active. All servers with which my Asterisk has been communicated are not listed. >>> >>> A port scan, to eventually update the list, found hundreds of servers provided in the address range 217.0.0.0/13 with open port 5060, some were even not found. I think there must be another solution. >>> >>> If I change insecure to insecure=port,invite - could that be a solution? >>> >>> Or should I try to change to res_pjsip (upgrade to Asterisk 13 is no problem)? Has there anyone experience with dynamic ip addresses of Asterisk? >>> >>> Daniel >>> >>>> Am 30.03.2015 um 20:09 schrieb Sebastian Kemper <sebastian_ml at gmx.net>: >>>> >>>> On Mon, Mar 30, 2015 at 06:31:46PM +0200, Daniel Heckl wrote: >>>>> Hello >>>>> >>>>> I use Asterisk 11 with FreePBX 12. Our SIP Provider is Telekom >>>>> Germany. We have sometimes problems with incoming and outgoing calls. >>>>> I hope I can explain it understandable. >>>> >>>> Hello Daniel, >>>> >>>> I'll find myself in the same situation a few weeks from now :-) >>>> >>>>> >>>>> For example, Asterisk sends a REGISTER to 217.0.23.68 (tel.t-online.de >>>>> <http://tel.t-online.de/>), the message is answered with OK and the >>>>> peer is registered. >>>>> >>>>> Usually INVITES comes now from this ip address. All works fine. But >>>>> sometimes INVITES comes from an other IP address, for example >>>>> 217.0.23.100. This request Asterisk responds with 401 Unauthorized. >>>>> >>>>> In the next register procedure REGISTER are sent to the new ip address >>>>> and answered also with OK. But qualify OPTIONS are continue be sent to >>>>> the old ip address. Incoming and outgoing calls are canceled. Outgoing >>>>> calls are answered with Forbidden. >>>>> >>>>> Even if the REGISTER procedure works with the new ip address, the >>>>> peers are connected with the old address. >>>>> >>>>> Waiting doesn?t help, only a ?sip reload? update the ip address of the >>>>> peer. >>>>> >>>>> What is the solution for this problem? How can asterisk update the >>>>> peer? >>>> >>>> I think the solution - for the inbound issue at least - could be to add >>>> more hosts as a peer. Have a looks at this forum post: >>>> >>>> http://www.ip-phone-forum.de/showthread.php?t=268787&p=1999371&viewfull=1#post1999371 >>>> >>>> The user used a template and than he added peers, each with its own IP >>>> address. The provided list was last updated in 2014, though, so I assume >>>> the provider in the meantime has added to that list. >>>> >>>> It looks pretty tedious, though, I mean there could be dozens of IPs >>>> you'd have to add. But I guess this is the way to go with Asterisk 11 >>>> and chan_sip. >>>> >>>> The future looks brighter :-) I read that with pjsip, which I understand >>>> is the replacement for chan_sip, you can have one peer entry and match >>>> an IP range instead of a single host. That should tidy up the dialplan. >>>> >>>> What I'm a little afraid of is the SIP provider using IPs out of a range >>>> that they also use for other services. Maybe out of the same range they >>>> hand out IPs to their customers. I guess we got to be careful :-) >>>> >>>> Kind regards, >>>> Sebastian >>>> >>>>> The Asterisk is local behind a NAT with a firewall, following settings >>>>> are used: >>>>> >>>>> externhost with DynDNS stun with stun.t-online.de >>>>> <http://stun.t-online.de/> nat=yes srvlookup=yes allowguest=no >>>>> trustrpid=no insecure=invite qualify=yes >>>>> >>>>> Thank you! 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 >>>> >>>> >>>> -- >>>> _____________________________________________________________________ >>>> -- 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 >> >> -- >> _____________________________________________________________________ >> -- 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 > > > > -- > > Scott Griepentrog > Digium, Inc ? Software Developer > 445 Jan Davis Drive NW ? Huntsville, AL 35806 ? US > direct/fax: +1 256 428 6239 ? mobile: +1 256 580 6090 > Check us out at: http://digium.com ? http://asterisk.org > -- > _____________________________________________________________________ > -- 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/20150401/bdc5ca19/attachment.html>
If I correctly understand what the problem is, what I did was write a script that runs out of CRON every 15 minutes. It checks the outside IP address by querying http://checkip.dyndns.org and compares it to the IP address stored in the parameter ?externip? in the [general] section of sip.conf. If the two values are the same, the script exits quietly. If they are different, the script updates ?externip? with the new address, does a sip reload, and shoots me an email saying there was an update. It's a fairly simple and straightforward process and does the job. I use this script for all PBX?s that are behind a NAT. I hope this helps. Regards; John From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Daniel Heckl Sent: Wednesday, April 01, 2015 2:56 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Update peer IP address Scott, thank you four your reply. I had already though about both options, but the problem is, that after an ip change AND a new registration the ip address of the peer is not updated automatically. INVITES are answered with 401. Only after a sip reload the peer works again. That can't be normal... Daniel Am 31.03.2015 um 22:45 schrieb Scott Griepentrog <sgriepentrog at digium.com>: You have two options for dealing with an IP change during the registration period: 1) set the registration time to shorter period of time to minimize the downtime 2) detect that the IP address has changed via whatever method available, and then issue a "sip reload" CLI command to asterisk, which will cause it to resend registrations immediately. On Tue, Mar 31, 2015 at 1:36 PM, Daniel Heckl <daniel.heckl at gmail.com> wrote: Maybe someone could elaborate on my first question again. If the ip address changes while a REGISTER period, the ip address of the peer isn't been updated. How can asterisk update the ip address of the peer? Am 31.03.2015 um 12:36 schrieb Daniel Heckl <daniel.heckl at gmail.com>: Hello Sebastian, I had already seen this list of the hosts, but it is not active. All servers with which my Asterisk has been communicated are not listed. A port scan, to eventually update the list, found hundreds of servers provided in the address range 217.0.0.0/13 with open port 5060, some were even not found. I think there must be another solution. If I change insecure to insecure=port,invite - could that be a solution? Or should I try to change to res_pjsip (upgrade to Asterisk 13 is no problem)? Has there anyone experience with dynamic ip addresses of Asterisk? Daniel Am 30.03.2015 um 20:09 schrieb Sebastian Kemper <sebastian_ml at gmx.net>: On Mon, Mar 30, 2015 at 06:31:46PM +0200, Daniel Heckl wrote: Hello I use Asterisk 11 with FreePBX 12. Our SIP Provider is Telekom Germany. We have sometimes problems with incoming and outgoing calls. I hope I can explain it understandable. Hello Daniel, I'll find myself in the same situation a few weeks from now :-) For example, Asterisk sends a REGISTER to 217.0.23.68 (tel.t-online.de <http://tel.t-online.de/>), the message is answered with OK and the peer is registered. Usually INVITES comes now from this ip address. All works fine. But sometimes INVITES comes from an other IP address, for example 217.0.23.100. This request Asterisk responds with 401 Unauthorized. In the next register procedure REGISTER are sent to the new ip address and answered also with OK. But qualify OPTIONS are continue be sent to the old ip address. Incoming and outgoing calls are canceled. Outgoing calls are answered with Forbidden. Even if the REGISTER procedure works with the new ip address, the peers are connected with the old address. Waiting doesn?t help, only a ?sip reload? update the ip address of the peer. What is the solution for this problem? How can asterisk update the peer? I think the solution - for the inbound issue at least - could be to add more hosts as a peer. Have a looks at this forum post: http://www.ip-phone-forum.de/showthread.php?t=268787 <http://www.ip-phone-forum.de/showthread.php?t=268787&p=1999371&viewfull=1#post1999371> &p=1999371&viewfull=1#post1999371 The user used a template and than he added peers, each with its own IP address. The provided list was last updated in 2014, though, so I assume the provider in the meantime has added to that list. It looks pretty tedious, though, I mean there could be dozens of IPs you'd have to add. But I guess this is the way to go with Asterisk 11 and chan_sip. The future looks brighter :-) I read that with pjsip, which I understand is the replacement for chan_sip, you can have one peer entry and match an IP range instead of a single host. That should tidy up the dialplan. What I'm a little afraid of is the SIP provider using IPs out of a range that they also use for other services. Maybe out of the same range they hand out IPs to their customers. I guess we got to be careful :-) Kind regards, Sebastian The Asterisk is local behind a NAT with a firewall, following settings are used: externhost with DynDNS stun with stun.t-online.de <http://stun.t-online.de/> nat=yes srvlookup=yes allowguest=no trustrpid=no insecure=invite qualify=yes Thank you! 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 -- _____________________________________________________________________ -- 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 -- _____________________________________________________________________ -- 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 -- Image removed by sender. Digium logo Scott Griepentrog Digium, Inc ? Software Developer 445 Jan Davis Drive NW ? Huntsville, AL 35806 ? US direct/fax: +1 256 428 6239 ? mobile: +1 256 580 6090 Check us out at: http://digium.com ? http://asterisk.org -- _____________________________________________________________________ -- 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/20150401/53c00765/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 521 bytes Desc: not available URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150401/53c00765/attachment-0001.jpg>