Hello, linphone 3.6.1 which is available in current Debian stable has a nasty bug. It does not properly escape contact and entity information in XML body of PUBLISH presence packet.
It happen when you e.g. put '<' or '>' character in SIP configuration setting. E.g.: User <sip:USER@HOST> Below is tcpdump of UDP packets produced by linphone and sent to Kamailio SIP server. As those XML bodies are not valid XML files Kamailio returns an error. I reported this problem to Kamailio mailing list and they identified that problem is really in linphone SIP client which send invalid garbage to server. https://lists.kamailio.org/pipermail/sr-users/2018-June/101993.html Instead of <presence ... entity="User <sip:USER@HOST>"> <contact priority="0.8">User <sip:USER@HOST></contact> there should be: <presence ... entity="User <sip:USER@HOST>"> <contact priority="0.8">User <sip:USER@HOST></contact> Can you fix this bug and properly escape XML input data prior to sending them to server? 21:58:58.704792 IP (tos 0x68, ttl 64, id 64109, offset 0, flags [DF], proto UDP (17), length 32) LINPHONE_IP_ADDRESS.5060 > KAMAILIO_IP_ADDRESS.5060: SIP 21:58:58.704919 IP (tos 0x68, ttl 64, id 64110, offset 0, flags [DF], proto UDP (17), length 752) LINPHONE_IP_ADDRESS.5060 > KAMAILIO_IP_ADDRESS.5060: SIP, length: 724 PUBLISH sip:USER@HOST SIP/2.0 Via: SIP/2.0/UDP LINPHONE_IP_ADDRESS:5060;rport;branch=z9hG4bK2049418743 From: User <sip:USER@HOST>;tag=184282924 To: User <sip:USER@HOST> Call-ID: 1435474953 CSeq: 26 PUBLISH Content-Type: application/pidf+xml Max-Forwards: 70 User-Agent: Linphone/3.6.1 (eXosip2/4.1.0) Expires: 600 Event: presence Content-Length: 353 <?xml version="1.0" encoding="UTF-8"?> <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="User <sip:USER@HOST>"> <tuple id="sg89ae"> <status><basic>closed</basic></status> <contact priority="0.8">User <sip:USER@HOST></contact> </tuple> </presence> 21:58:58.710097 IP (tos 0x10, ttl 53, id 10255, offset 0, flags [none], proto UDP (17), length 473) KAMAILIO_IP_ADDRESS.5060 > LINPHONE_IP_ADDRESS.5060: SIP, length: 445 SIP/2.0 407 Proxy Authentication Required Via: SIP/2.0/UDP LINPHONE_IP_ADDRESS:5060;rport=5060;branch=z9hG4bK2049418743;received=EXTERNAL_IP_ADDRESS From: User <sip:USER@HOST>;tag=184282924 To: User <sip:USER@HOST>;tag=515cb47c4c34ffa85b598d6b25676122.744d Call-ID: 1435474953 CSeq: 26 PUBLISH Proxy-Authenticate: Digest realm="HOST", nonce="NONCE" Server: kamailio (4.4.4 (x86_64/linux)) Content-Length: 0 21:58:58.718147 IP (tos 0x68, ttl 64, id 64111, offset 0, flags [DF], proto UDP (17), length 940) LINPHONE_IP_ADDRESS.5060 > KAMAILIO_IP_ADDRESS.5060: SIP, length: 912 PUBLISH sip:USER@HOST SIP/2.0 Via: SIP/2.0/UDP LINPHONE_IP_ADDRESS:5060;rport;branch=z9hG4bK1165141043 From: User <sip:USER@HOST>;tag=184282924 To: User <sip:USER@HOST> Call-ID: 1435474953 CSeq: 27 PUBLISH Proxy-Authorization: Digest username="USER", realm="HOST", nonce="NONCE", uri="sip:USER@HOST", response="RESP", algorithm=MD5 Content-Type: application/pidf+xml Max-Forwards: 70 User-Agent: Linphone/3.6.1 (eXosip2/4.1.0) Expires: 600 Event: presence Content-Length: 353 <?xml version="1.0" encoding="UTF-8"?> <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="User <sip:USER@HOST>"> <tuple id="sg89ae"> <status><basic>closed</basic></status> <contact priority="0.8">User <sip:USER@HOST></contact> </tuple> </presence> 21:58:58.781668 IP (tos 0x10, ttl 53, id 10259, offset 0, flags [none], proto UDP (17), length 380) KAMAILIO_IP_ADDRESS.5060 > LINPHONE_IP_ADDRESS.5060: SIP, length: 352 SIP/2.0 415 Unsupported media type Via: SIP/2.0/UDP LINPHONE_IP_ADDRESS:5060;rport=5060;branch=z9hG4bK1165141043;received=EXTERNAL_IP_ADDRESS From: User <sip:USER@HOST>;tag=184282924 To: User <sip:USER@HOST>;tag=97d8e785fdf42bf9622a64c13c504961-3901 Call-ID: 1435474953 CSeq: 27 PUBLISH Server: kamailio (4.4.4 (x86_64/linux)) Content-Length: 0 -- Pali Rohár [email protected] _______________________________________________ Linphone-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/linphone-users
