Re: [asterisk-users] Bug or feature in 1.6.1 (Was: How to register with TCP transport) ?

2009-05-26 Thread Olivier
I filed https://issues.asterisk.org/view.php?id=15202
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Bug or feature in 1.6.1 (Was: How to register with TCP transport) ?

2009-05-26 Thread Olivier
Hi,

Digging on this case :

2009/5/26 Olivier 

> Hi,
>
> In my sip.conf, I've got :
> [general](+)
> ;   
> register=>tcp://trunk4ipbx:passw...@192.168.100.129
> 
> register=>trunk4ipbx:passw...@192.168.100.129
>
> When I'm using the TCP line instead of the other, I've got :
> [May 26 17:58:42] NOTICE[2859]: chan_sip.c:20169 sip_parse_host: '/' is not
> a valid port number on line 25 of sip.conf. using default.
> [May 26 17:58:42] WARNING[2859]: chan_sip.c:6560 sip_register: Format for
> registration is
> [transport://]user[:secret[:authuse...@domain[:port][/extension][~expiry] at
> line 25
>
>
> Is this 
> "register=>tcp://trunk4ipbx:passw...@192.168.100.129"
> statement correct ?
>
> Regards
>


I read in chan_sip.c that block inside sip_register :

   /* split [/contact][~expiry] */
expire = strchr(buf, '~');
if (expire)
*expire++ = '\0';
callback = strrchr(buf, '/');// My comment: contact is
search at the end of input register line
if (callback)
*callback++ = '\0';
if (ast_strlen_zero(callback))
callback = "s";

sip_parse_host(buf, lineno, &username, &portnum, &transport);

Given an input line such as "register=>tcp://
trunk4ipbx:passw...@192.168.100.129 ",
register line is truncated as the last occurence of '/' is the "tcp://"
string.
When commenting out this "callback = strrchr(buf, '/');" , input line
"register=>tcp://trunk4ipbx:passw...@192.168.100.129"
seems to be processed appropriately.

My question is "is this legal to input register lines without any /contact
field ?
If positive, then there is a bug is 1.6.1.
If negative, would you agree to have a more appropriate logging than
"sip_parse_host: '/' is not a valid port number ..." ?

Regards
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users