[asterisk-users] Update peer IP address

Sebastian Kemper sebastian_ml at gmx.net
Mon Mar 30 13:09:04 CDT 2015

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 (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
> 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:


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,

> 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

More information about the asterisk-users mailing list