[Home]

Summary:ASTERISK-13164: [patch] Registrations using a username without domain will fail.
Reporter:Nikos Mavrogianopoulos (nmav)Labels:
Date Opened:2008-12-03 11:16:56.000-0600Date Closed:2009-01-13 16:20:27.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) domain.patch
Description:When registering using a username that does not have the '@' appended with domain fails. I see something like

Retransmitting ASTERISK-2 (no NAT) to 192.168.240.18:5060:
REGISTER sip:92.168.240.18 SIP/2.0
Via: SIP/2.0/UDP 172.16.1.104:5060;branch=z9hG4bK0a15b89a;rport

The attached patch seems to fix the issue.
Comments:By: Leif Madsen (lmadsen) 2008-12-03 11:19:53.000-0600

Can you show us an example of the registration you're using?

By: Nikos Mavrogianopoulos (nmav) 2008-12-03 11:23:13.000-0600

The sip.conf registration line is:
register => test@192.168.240.18:test:test@192.168.240.18:5060/2104000001

And full the registration message:
Retransmitting ASTERISK-1 (no NAT) to 192.168.240.18:5060:
REGISTER sip:92.168.240.18 SIP/2.0
Via: SIP/2.0/UDP 172.16.1.104:5060;branch=z9hG4bK06a8851c;rport
From: <sip:test@192.168.240.18>;tag=as0fdc71e2
To: <sip:test@192.168.240.18>
Call-ID: 1bdff3060811e32e095dcf2357a52439@192.168.1.254
CSeq: 116 REGISTER
User-Agent: Asterisk
Max-Forwards: 70
Expires: 300
Contact: <sip:2104000002@172.16.1.104>
Event: registration
Content-Length: 0



By: Nikos Mavrogianopoulos (nmav) 2008-12-03 11:25:24.000-0600

The commit that changed the previous behaviour is:

2008-07-01 14:59 +0000 [r126735-126902]  Olle Johansson <oej@edvina.net>

       * channels/chan_sip.c: Use domain part of SIP uri in register=
         configuration as fromdomain. Reported by: one47 Patches:
         sip-reg-fromdom2.dpatch uploaded by one47 (license 23) (closes
         issue ASTERISK-11876)

By: Nikos Mavrogianopoulos (nmav) 2008-12-04 02:30:43.000-0600

I seems I wasn't very clear. The problem is the line:
REGISTER sip:92.168.240.18 SIP/2.0

which should have been:
REGISTER sip:192.168.240.18 SIP/2.0

By: Leif Madsen (lmadsen) 2008-12-15 10:32:42.000-0600

I believe this is part of another issue putnopvut is working on, so I'm assigning this to him until I can find the other issue(s) and get them all linked together.

By: Leif Madsen (lmadsen) 2008-12-15 10:45:00.000-0600

Can you try with the latest 1.4 branch? It seems a bunch of changes have happened recently that should have resolved this issue for you. Can you retest and report back?

Thanks!

By: Mark Michelson (mmichelson) 2008-12-15 10:47:07.000-0600

This issue should be fixed in the 1.4 branch in subversion. There was a fix committed to the ast_string_field_set macro which prevents arguments with side-effects (like ++fromdomain) from having the side-effects executed multiple times. This fix is in a similar vein to your fix, and so I believe that if you try with a recent checkout of the 1.4 branch, you should see that your problem is gone. Please let me know if this is not the case.

By: Leif Madsen (lmadsen) 2009-01-13 16:20:26.000-0600

This issue is being closed as it is believed to have been resolved. If this is not the case, please find a bug marshal on the IRC network irc.freenode.net in the channel #asterisk-bugs, and request it to be reopened.

Thanks!