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

Olivier oza-4h07 at myamail.com
Tue May 26 14:30:20 CDT 2009


Hi,

Digging on this case :

2009/5/26 Olivier <oza-4h07 at myamail.com>

> Hi,
>
> In my sip.conf, I've got :
> [general](+)
> ;       register=>tcp://trunk4ipbx:password@192.168.100.129<trunk4ipbx%3Apassword@192.168.100.129>
>         register=>trunk4ipbx:password at 192.168.100.129<trunk4ipbx%3Apassword at 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[:authuser]]@domain[:port][/extension][~expiry] at
> line 25
>
>
> Is this "register=>tcp://trunk4ipbx:password@192.168.100.129<trunk4ipbx%3Apassword@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:password at 192.168.100.129 <trunk4ipbx%3Apassword at 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:password@192.168.100.129<trunk4ipbx%3Apassword@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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090526/39becdb5/attachment.htm 


More information about the asterisk-users mailing list