Summary:ASTERISK-15182: [patch] [regression] Asterisk sip.conf realtime register, contact problem
Reporter:Maciej Krajewski (jamicque)Labels:
Date Opened:2009-12-21 09:59:40.000-0600Date Closed:2010-01-22 18:42:14.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 20100114__issue16491.diff.txt
Description:When I have a config of sip_ps in realtime I've noticed the regestration problem in sip.conf.
The config in DB looks like:
sip.conf general register jamicque:xxx@sip.xxx.xxx:5060/jamicque

than the  register send by asterisk to provider looks like (please look at the contact header):

REGISTER 13 headers, 0 lines
Reliably Transmitting (no NAT) to
REGISTER sip:sip.xxx.xxx SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK40e31a75;rport
Max-Forwards: 70
From: <sip:jamicque@sip.xxx.xxx>;tag=as48167c5e
To: <sip:jamicque@sip.xxx.xxx>
Call-ID: 0a812221399f1a927fb46039266a4136@
User-Agent: xxx
Authorization: Digest username="jamicque", realm="sip.xxx.xxx", algorithm=MD5, uri="sip:sip.freeconet.pl", nonce="4b2f9aed189e6af29c9b5b4307ff625414486c2b", response="00f2b29e3a240406fa47bcbdff9e10b6"
Expires: 60
Contact: <sip:s@>
Event: registration
Content-Length: 0

When I remove the port information from my reltime registration:
sip.conf general register jamicque:xxx@sip.xxx.xxx/jamicque

the contact in register is ok.

Comments:By: Walter Doekes (wdoekes) 2009-12-21 19:02:23.000-0600

It works fine over here with asterisk and realtime_static and res_odbc.

If I append "/abc" after the host/port, I get """Contact: <sip:abc@>""" like expected.

You wouldn't happen to have your var_val column length set to 30 characters, would you?

By: Maciej Krajewski (jamicque) 2009-12-22 02:40:30.000-0600

in works fine, but in not.

By: Tilghman Lesher (tilghman) 2010-01-14 16:27:35.000-0600

The uploaded patch is a backport of the register line parsing changes we've made in trunk, to deal with lots of other parsing issues.  Please test and report back whether it fixes the issue for you.

By: Tilghman Lesher (tilghman) 2010-01-22 09:59:16.000-0600

jamicque:  I need your feedback here.

By: Maciej Krajewski (jamicque) 2010-01-22 14:19:44.000-0600

sorry for late response.
Everything is okay now.

By: Digium Subversion (svnbot) 2010-01-22 18:42:12.000-0600

Repository: asterisk
Revision: 242514

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_sip.c
U   branches/1.6.0/configs/sip.conf.sample

r242514 | tilghman | 2010-01-22 18:42:09 -0600 (Fri, 22 Jan 2010) | 55 lines

Backporting register line parsing from trunk to fix a bad parsing error in 1.6.0.

(closes issue ASTERISK-15182)
Reported by: jamicque
      20100114__issue16491.diff.txt uploaded by tilghman (license 14)
Tested by: jamicque

 r213098 | tilghman | 2009-08-19 16:05:17 -0500 (Wed, 19 Aug 2009) | 9 lines
 Better parsing for the "register" line
 Allows characters that are otherwise used as delimiters to be used within
 certain fields (like the secret).
 (closes issue ASTERISK-14045, closes issue ASTERISK-14612)
  Reported by: tilghman
        20090818__issue15008.diff.txt uploaded by tilghman (license 14)
  Tested by: lmadsen, tilghman
 r213635 | dvossel | 2009-08-21 16:02:50 -0500 (Fri, 21 Aug 2009) | 5 lines
 fixes sip register parsing when user@domain is used
 (issue ASTERISK-14045)
 (issue ASTERISK-14612)
 r215222 | tilghman | 2009-09-01 16:19:40 -0500 (Tue, 01 Sep 2009) | 3 lines
 Fix register such that lines with a transport string, but without an authuser, parse correctly.
 r215801 | tilghman | 2009-09-02 22:43:51 -0500 (Wed, 02 Sep 2009) | 5 lines
 Default the callback extension to "s".  This is a regression.
 (closes issue ASTERISK-14697)
  Reported by: elguero
  Change-type: bugfix
 r235132 | dvossel | 2009-12-15 12:43:06 -0600 (Tue, 15 Dec 2009) | 14 lines
 reverse minor sip registration regression
 A registration regression caused by a code tweak in (issue ASTERISK-13448)
 and a bug fix in (issue ASTERISK-14501) caused some sip registration
 config entries to be constructed incorrectly.  Origially
 issue ASTERISK-13448 contained the code tweak as well as a bug fix, but since
 the issue was reported as a tweak the bug fix portion was moved into
 issue ASTERISK-14501.  Both the tweak and the bug fix contained minor incorrect
 logic that resulted in some SIP registrations to fail.
 (issue ASTERISK-13448)
 (issue ASTERISK-14501)