S
sieg1974
Hi,
This piece of code returns ip = -1062731404 (192.168.1.116) and port =
5069, when the following buffer is used. Can someone explain me how
"%x.%x" is matching "192.168.1.116:5069"?
int ip,port;
sscanf(buf+tagStart+strlen("branch="),"%x.%x",&ip,&port);
Thanks,
Andre
z9hG4bK8a948468-ee78-db11-9cdf-00112f2f2fed;rport
From: <sip:[email protected]>;tag=82888468-ee78-db11-9cdf-00112f2f2fed
To: <sip:[email protected]>;tag=as3a286274
Call-ID: ecdb2bb4-de78-db11-9cdf-00112f2f2fed@dilbert
CSeq: 244 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Expires: 3600
Contact: <sip:[email protected]:5069;transport=udp>;expires=3600
Date: Wed, 22 Nov 2006 23:23:08 GMT
Content-Length: 0
This piece of code returns ip = -1062731404 (192.168.1.116) and port =
5069, when the following buffer is used. Can someone explain me how
"%x.%x" is matching "192.168.1.116:5069"?
int ip,port;
sscanf(buf+tagStart+strlen("branch="),"%x.%x",&ip,&port);
Thanks,
Andre
z9hG4bK8a948468-ee78-db11-9cdf-00112f2f2fed;rport
From: <sip:[email protected]>;tag=82888468-ee78-db11-9cdf-00112f2f2fed
To: <sip:[email protected]>;tag=as3a286274
Call-ID: ecdb2bb4-de78-db11-9cdf-00112f2f2fed@dilbert
CSeq: 244 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Expires: 3600
Contact: <sip:[email protected]:5069;transport=udp>;expires=3600
Date: Wed, 22 Nov 2006 23:23:08 GMT
Content-Length: 0