[asterisk-dev] ast_sockaddr_stringify

Johann Steinwendtner steinwendtner at gmx.net
Fri Feb 24 09:35:48 CST 2012


On 2012-02-24 15:32, Matthew Jordan wrote:
> ----- Original Message -----
>> From: "Johann Steinwendtner"<steinwendtner at gmx.net>
>> To: "Asterisk Developers Mailing List"<asterisk-dev at lists.digium.com>
>> Sent: Friday, February 24, 2012 7:00:44 AM
>> Subject: [asterisk-dev] ast_sockaddr_stringify
>>
>> Hello !
>>
>> Should the output of ast_sockaddr_stringify when passing a NULL
>> pointer really be "(null)" ?
>>
>
> Why not?  You've asked the function to turn an address into a string, but
> provided a NULL address object or an object that has its memory allocated,
> but has 0 length.
>
> In that situation, the fact that it returns anything is at least definable
> behavior.
>
Yes, but than the usage is incorrect. (null) is not an ip address to me.
in my system: sip show peer <peername> prints:
Defaddr->IP  : (null)

Howwever, iax2 show peer  <peername> prints:
Defaddr->IP  : 0.0.0.0 Port 0


Regards

Hans



More information about the asterisk-dev mailing list