Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-22 Thread Hans Witvliet
-Original Message-
From: Jaap Winius jwin...@umrk.nl
Reply-to: Asterisk Users Mailing List - Non-Commercial Discussion
asterisk-users@lists.digium.com
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] SIP account registration fails after
upgrade to 1.8
Date: Fri, 22 Mar 2013 02:46:43 + (UTC)

On Thu, 21 Mar 2013 16:35:16 +, Jaap Winius wrote:

 Hopefully, my ISP will see fit to squash this bug ASAP.

Well, I got my answer from them quickly enough: Nope.

Luckily, somebody was kind enough to suggest a workaround. Unfortunately, 
it involves, downloading the source code and making a few changes to it 
to prevent Asterisk from adding '@IPaddress' to the end of the Call-ID 
string. Nevertheless, it's easy enough to do. The idea is to look for 
this string that appears twice in ./channels/chan_sip.c:

  ast_string_field_build(pvt, callid, %s@%s,
  generate_random_string(buf, sizeof(buf)), host);

And to change it to:

  ast_string_field_build(pvt, callid, %s,
  generate_random_string(buf, sizeof(buf)));

Now my Call-IDs look like this:

   Call-ID: 63935a8d2144d4f1309024fd7612f608

Instead of this:

   Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:abcd:1::a]

Still, I'd much prefer that my ISP fixed the problem instead, because now 
every time a security update becomes available for Asterisk, I'm going to 
have to download the source code, make the same changes, recompile it and 
install it all over again and again. Ho hum.

Of course, an even better solution would be if Asterisk had a variable 
with which to alter the Call-ID string format so that I could omit the IP 
address. :-)

Cheers,

Jaap

-Original Message-

Hi Jaap,

just wondering, might this perhaps be an IPv6 quirk?
By altering '@IPaddress'  you got rid of : '@[2001:888:abcd:1::a]'
Does the dame happen with V4-only?

I presume you didn't activate V6 at your end lately?
Other idea (perhaps pointless), you got the numeric address, would the
same issue still exists if '2001:888:abcd:1::a' could be translater back
into a dns-name? (include it in your /etc/hosts ?)

Sometimes the '[]' cause some side-effects (specially if some regex are
used unseen)


Groet, hw


--
_
-- 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


Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-22 Thread Jaap Winius
On Thu, 21 Mar 2013 16:35:16 +, Jaap Winius wrote:

 ... For example, if my server sends it a SIP packet with a
 register request and a Call-ID that looks like this:
 
Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:abcd:1::a]
 
 ... somewhere along they line they end up changing it to this:
 
Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:ABCD:1::A]
 
Actually, I have to correct myself here. Not only was the SIP server at 
sip.xs4all.nl changing the lower case letters of the IPv6 section in any  
Call-IDs to upper case, it was also expanding the addresses, like so:

  Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:ABCD:1:0:0:0:A]

So, that SIP server was (and still is as of this writing) actually making 
two mistakes instead of just one.

My apologies for not being entirely accurate the first time around.

Cheers,

Jaap


--
_
-- 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


Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-22 Thread Jaap Winius
On Fri, 22 Mar 2013 02:46:43 +, Jaap Winius wrote:

 Of course, an even better solution would be if Asterisk had a variable
 with which to alter the Call-ID string format so that I could omit the
 IP address. :-)

It turns out that there in a variable that can do exactly that, and is 
therefore the solution to this problem: 'fromdomain=domain_name'. Once 
placed in the [general] section of your sip.conf, Asterisk will generate 
Call-IDs for its SIP packets that end with an '@' followed by your chosen 
domain name instead of your server's IPv6 address.

Thanks to Rob van der Putten for this solution!

Cheers,

Jaap


--
_
-- 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


Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-21 Thread Jaap Winius
On Tue, 19 Mar 2013 02:15:10 +, Jaap Winius wrote:

 Following an upgrade from Debian squeeze to wheezy, and Asterisk 1.6.2.9
 to 1.8.13, my server is no longer able to register a connection to a SIP
 account at my ISP (XS4ALL in the Netherlands). At the same time, it is
 still able to register a different account with another SIP provider...

To answer my own question, this turned out to be due to a bug in the SIP 
server at XS4ALL. I discovered it after using tcpdump to examine the 
exchange of packets during my registration attempts and noticing that 
Asterisk 1.8.13.1 was using an IPv6 address in the Call-ID instead of an 
IPv4 address as before. According to the specification for SIP 2.0 (RFC 
3261) this is perfectly legal, just as long as both parties treat the 
entire Call-ID as a string and never make any changes to it.

However, I discovered that is was exactly what the SIP server at XS4ALL 
is doing. For example, if my server sends it a SIP packet with a register 
request and a Call-ID that looks like this:

   Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:abcd:1::a]

... somewhere along they line they end up changing it to this:

   Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:ABCD:1::A]

In other words, it is treating the latter part of the Call-ID not as a 
string, but as an IPv6 address and has taken it upon itself to change all 
of the letters in that address to upper case. This changes the Call-ID 
and thus my registration attemp cannot be completed. Of course, this 
won't affect you if you happen to have an IPv6 address without any 
letters in it.

This situation is in contrast to another SIP provider that I use, 
sip.internetcalls.com, with which I currently have no problems because 
they leave such Call-IDs unchanged. I don't know what kind of SIP server 
software they use, but XS4ALL appears to be using Cirpack 4.42a.

This bug is very similar to another one described in this forum exchange:

   http://forums.asterisk.org/viewtopic.php?f=1t=84603start=0

Here, a SIP server at an ISP was taking the IPv6 address at the end of a 
Call-ID and expanding it, e.g. from ::1 (the IPv6 loopback address) to 
0:0:0:0:0:0:0:1. In both that case and in mine, we get the same result: 
an altered Call-ID that leads to endless timeouts and no registration.

Hopefully, my ISP will see fit to squash this bug ASAP.


--
_
-- 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


Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-21 Thread Jaap Winius
On Thu, 21 Mar 2013 16:35:16 +, Jaap Winius wrote:

 Hopefully, my ISP will see fit to squash this bug ASAP.

Well, I got my answer from them quickly enough: Nope.

Luckily, somebody was kind enough to suggest a workaround. Unfortunately, 
it involves, downloading the source code and making a few changes to it 
to prevent Asterisk from adding '@IPaddress' to the end of the Call-ID 
string. Nevertheless, it's easy enough to do. The idea is to look for 
this string that appears twice in ./channels/chan_sip.c:

  ast_string_field_build(pvt, callid, %s@%s,
  generate_random_string(buf, sizeof(buf)), host);

And to change it to:

  ast_string_field_build(pvt, callid, %s,
  generate_random_string(buf, sizeof(buf)));

Now my Call-IDs look like this:

   Call-ID: 63935a8d2144d4f1309024fd7612f608

Instead of this:

   Call-ID: 4991f57656d159925b296e5b3b06496b@[2001:888:abcd:1::a]

Still, I'd much prefer that my ISP fixed the problem instead, because now 
every time a security update becomes available for Asterisk, I'm going to 
have to download the source code, make the same changes, recompile it and 
install it all over again and again. Ho hum.

Of course, an even better solution would be if Asterisk had a variable 
with which to alter the Call-ID string format so that I could omit the IP 
address. :-)

Cheers,

Jaap


--
_
-- 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


Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-19 Thread Asghar Mohammad
hi,
try srvlookup=yes

On Tue, Mar 19, 2013 at 3:15 AM, Jaap Winius jwin...@umrk.nl wrote:

 Hi folks,

 Following an upgrade from Debian squeeze to wheezy, and Asterisk 1.6.2.9
 to 1.8.13, my server is no longer able to register a connection to a SIP
 account at my ISP (XS4ALL in the Netherlands). At the same time, it is
 still able to register a different account with another SIP provider, so
 it must be that they no longer have the same basic requirements.

 The relevant part of my sip.conf looks like this:

 [general]
 context=incoming-j
 canreinvite=no
 dtmfmode=inband
 qualify=yes
 srvlookup=no
 disallow=all
 allow=alaw
 allow=ulaw
 allow=g722
 allow=g726
 allow=g729
 insecure=port,invite
 register = telno:password@sip.xs4all.nl/telno

 Does anyone know of any new variables that have been introduced since
 Asterisk 1.6.2.9, that apply here and might be causing this problem?

 Thanks,

 Jaap


 --
 _
 -- 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

Re: [asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-19 Thread Jaap Winius
On Tue, 19 Mar 2013 11:58:22 +0100, Asghar Mohammad wrote:

 try srvlookup=yes

Already tried that, but enabling DNS lookups makes no difference when 
establishing the SIP connection. The error message that I keep seeing at 
the console looks like this:

[Mar 19 12:47:21] NOTICE[7494]: chan_sip.c:13171 sip_reg_timeout:-- 
Registration for 'telno@sip.xs4all.nl' timed out, trying again (Attempt 
#3)

Incidentally, I have remote access to two other Asterisk systems in the 
Netherlands with XS4ALL connections, both still Debian squeeze with 
Asterisk 1.6.2.9, and when I add my register line to their sip.conf 
files, which are virtually identical to mine (except for the context), it 
registers immediately. This shows that my account still works.

Moreover, I also have remote access to some more Asterisk systems with 
XS4ALL connections and Debian wheezy with Asterisk 1.8.13.1. When I add 
my register line to their sip.conf files, which are virtually identical 
(except for the context), it fails. For the rest those systems are pretty 
much like my own, but at least it demonstrates that the problem is not 
unique to my system and connection.

Oh, and all of these systems have srvlookup=no (default is yes).

Thanks anyway,

Jaap


--
_
-- 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


[asterisk-users] SIP account registration fails after upgrade to 1.8

2013-03-18 Thread Jaap Winius
Hi folks,

Following an upgrade from Debian squeeze to wheezy, and Asterisk 1.6.2.9 
to 1.8.13, my server is no longer able to register a connection to a SIP 
account at my ISP (XS4ALL in the Netherlands). At the same time, it is 
still able to register a different account with another SIP provider, so 
it must be that they no longer have the same basic requirements.

The relevant part of my sip.conf looks like this:

[general]
context=incoming-j
canreinvite=no
dtmfmode=inband
qualify=yes
srvlookup=no
disallow=all
allow=alaw
allow=ulaw
allow=g722
allow=g726
allow=g729
insecure=port,invite
register = telno:password@sip.xs4all.nl/telno

Does anyone know of any new variables that have been introduced since 
Asterisk 1.6.2.9, that apply here and might be causing this problem?

Thanks,

Jaap


--
_
-- 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