<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
did you try to set parameter server address?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="http://kamailio.org/docs/modules/5.2.x/modules/pua_reginfo.html#idm1031504764" id="LPlnk603610">http://kamailio.org/docs/modules/5.2.x/modules/pua_reginfo.html#idm1031504764</a><br>
</div>
<div id="LPBorder_GTaHR0cDovL2thbWFpbGlvLm9yZy9kb2NzL21vZHVsZXMvNS4yLngvbW9kdWxlcy9wdWFfcmVnaW5mby5odG1sI2lkbTEwMzE1MDQ3NjQ." class="LPBorder588752" contenteditable="false" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer588752" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td style="width: 100%;">
<div id="LPTitle588752" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor588752" href="http://kamailio.org/docs/modules/5.2.x/modules/pua_reginfo.html#idm1031504764" style="text-decoration: none; color: var(--themePrimary);">pua_reginfo Module - kamailio.org</a></div>
<div id="LPDescription588752" style="font-size: 14px; max-height: 100px; color: rgb(102, 102, 102); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden;">
Keeping different Servers in Sync regarding the location database Get notified, when a user registers: A presence-server, which handles offline message storage for an account, would get notified, when the user comes online.</div>
<div id="LPMetadata588752" style="font-size: 14px; font-weight: 400; color: rgb(166, 166, 166); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">
kamailio.org</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yasin CANER</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Pali Rohár <pali.rohar@gmail.com><br>
<b>Sent:</b> Wednesday, July 10, 2019 9:29 PM<br>
<b>To:</b> sr-users@lists.kamailio.org<br>
<b>Subject:</b> Re: [SR-Users] kamailio 4.4.4 fills IPv6 contact address when sending packet over IPv4</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Hi! Do you have any idea why Kamailio fills incorrect address into<br>
Contact header? And how to avoid it?<br>
<br>
On Sunday 30 June 2019 23:11:22 Pali Rohár wrote:<br>
> Hi!<br>
> <br>
> I detected strange problem that sip.linphone.org refuse to accept<br>
> presence information re-transmitted by kamailio 4.4.4 server.<br>
> <br>
> I debug this problem with tcpdump and I found out that problem is in<br>
> kamailio which fills IPv6 address into UDP datagram and that datagram is<br>
> sent via IPv4 socket to IPv4 address, to sip.linphone.org server. And<br>
> sip.linphone.org server does not have IPv6 connectivity, so correctly<br>
> return over IPv4 to sender just "400 Bad Contact Header" error.<br>
> <br>
> On my server is running kamailio 4.4.4 from Debian Stretch and I can<br>
> 100% reproduce this problem against public sip.linphone.org server.<br>
> <br>
> My server has both IPv4 and IPv6 connectivity and kamailio is listening<br>
> for both IPv4 and IPv6 connections.<br>
> <br>
> So why is kamailio sending IPv6 address over IPv4 and therefore makes it<br>
> impossible to communicate with non-IPv6 enabled servers? Looks like a<br>
> problem with choosing default/correct socket for Contact header.<br>
> <br>
> And how to fix this problem? Can you help me? I would like to have<br>
> working interconnection with linphone servers.<br>
> <br>
> Just to note I'm seeing this problem only for presence information<br>
> packets. Other requests, like INVITE or MESSAGE seems to work.<br>
> <br>
> Below is relevant tcpdump output. Some parts were replaced by {VAR}.<br>
> <br>
> PS: I'm not subscribed to list, so please CC my address when sending<br>
> reply. Thank you!<br>
> <br>
> <br>
> 17:22:58.121719 IP (tos 0x10, ttl 64, id 21629, offset 0, flags [none], proto UDP (17), length 1266)<br>
>     {MY_IPV4_ADDRESS}.5060 > 91.121.209.194.5060: [bad udp cksum 0xa099 -> 0x9825!] SIP, length: 1238<br>
>         NOTIFY sip:{REMOTE_NAME}@{REMOTE_USER_IPV4_ADDRESS}:5060;registering_acc=sip_linphone_org SIP/2.0<br>
>         Via: SIP/2.0/UDP {MY_IPV4_ADDRESS};branch=z9hG4bK2b55.88f93c20000000000000000000000000.0<br>
>         To: <sip:{REMOTE_NAME}@sip.linphone.org>;tag=75559182<br>
>         From: <sip:{MY_SIP_URI}>;tag=97d8e785fdf42bf9622a64c13c504961-2708<br>
>         CSeq: 2 NOTIFY<br>
>         Call-ID: 26cf9d5c019af2dc3302b770887bcc2e@0:0:0:0:0:0:0:0<br>
>         Route: <sip:91.121.209.194:5060;lr><br>
>         Content-Length: 597<br>
>         User-Agent: kamailio (4.4.4 (x86_64/linux))<br>
>         Max-Forwards: 70<br>
>         Event: presence<br>
>         Contact: <sip:{MY_IPV6_ADDRESS}:5060;transport=udp><br>
>         Subscription-State: active;expires=3600<br>
>         Content-Type: application/pidf+xml<br>
> <br>
>         <?xml version="1.0" encoding="UTF-8"?><br>
>         <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="Pali &lt;sip:{MY_SIP_URI}&gt;"><br>
>         <tuple id="sg89ae"><br>
>         <status><basic>open</basic></status><br>
>         <contact priority="0.8">Pali &lt;sip:{MY_SIP_URI}&gt;</contact><br>
>         </tuple><br>
> <br>
>           <tuple xmlns="urn:ietf:params:xml:ns:pidf" id="TA0C538B2"><br>
>             <status><br>
>               <basic>closed</basic><br>
>             </status><br>
>             <contact priority="1">sip:{MY_SIP_URI}</contact><br>
>             <timestamp>2019-04-19T17:20:36+02:00</timestamp><br>
>           </tuple><br>
>         </presence><br>
> <br>
> 17:22:58.151188 IP (tos 0x0, ttl 52, id 22949, offset 0, flags [none], proto UDP (17), length 373)<br>
>     91.121.209.194.5060 > {MY_IPV4_ADDRESS}.5060: [udp sum ok] SIP, length: 345<br>
>         SIP/2.0 400 Bad Contact Header<br>
>         Via: SIP/2.0/UDP {MY_IPV4_ADDRESS};branch=z9hG4bK2b55.88f93c20000000000000000000000000.0;rport=5060<br>
>         From: <sip:{MY_SIP_URI}>;tag=97d8e785fdf42bf9622a64c13c504961-2708<br>
>         To: <sip:{REMOTE_NAME}@sip.linphone.org>;tag=75559182<br>
>         Call-ID: 26cf9d5c019af2dc3302b770887bcc2e@0:0:0:0:0:0:0:0<br>
>         CSeq: 2 NOTIFY<br>
>         Content-Length: 0<br>
> <br>
> <br>
<br>
-- <br>
Pali Rohár<br>
pali.rohar@gmail.com<br>
</div>
</span></font></div>
</div>
</body>
</html>