Distrotech / libosip2

Mirror of git://git.savannah.gnu.org/osip.git
Other
4 stars 2 forks source link

via parse has some error #2

Open luzhongzhou opened 4 years ago

luzhongzhou commented 4 years ago

Tthe kamailio sip server send a package like this:

Frame 4: 772 bytes on wire (6176 bits), 772 bytes captured (6176 bits) Ethernet II, Src: Vmware_aa:8b:aa (00:50:56:aa:8b:aa), Dst: RealtekU_e3:08:95 (52:54:00:e3:08:95) Internet Protocol Version 4, Src: 192.168.2.4, Dst: 192.168.2.1 User Datagram Protocol, Src Port: 5060, Dst Port: 1031 Session Initiation Protocol (SUBSCRIBE) Request-Line: SUBSCRIBE sip:2491@192.168.2.1:1031;transport=udp;registering_acc=[2005::10] SIP/2.0 Message Header Record-Route: <sip:2005:0:0:0:0:0:0:10;lr> Via: SIP/2.0/UDP 2005:0:0:0:0:0:0:10:5060;branch=z9hG4bKa7e1.48a82723bf1d096df7d54fb4b07847bf.0 Via: SIP/2.0/UDP 192.168.2.1:1031;branch=z9hG4bK-323939-d761cd363e655664bbab51f50d1642e3 From: "2491" sip:2491@[2005::10]:1031;tag=2f128c4a To: "2491" sip:2491@[2005::10] Call-ID: ea341928c9e673e92911b415350fdfea@0:0:0:0:0:0:0:0 [Generated Call-ID: ea341928c9e673e92911b415350fdfea@0:0:0:0:0:0:0:0] CSeq: 1 SUBSCRIBE Contact: "2491" sip:2491@[2001:0:0:0:0:0:0:2]:13317;transport=udp;registering_acc=[2005::10] Event: presence.winfo Expires: 3600 Max-Forwards: 69 User-Agent: Jitsi2.10.5550Windows 7 Accept: application/watcherinfo+xml Content-Length: 0

as you can sess, the ipv6 address in via without Brackets. The code in: https://github.com/Distrotech/libosip2/blob/fb7f07d27692972b4909609197d5feb937b66b0e/src/osipparser2/osip_via.c#L226 is not correct in this case.