My guess would be that in the field, he has already deployed some servers which expect the To: field to be composed like that :) When I'll have a chance, I'll ask.<br><br>Anyway, I have tweaked the sofia_presence.c in a rather ugly way, hard coding the reference from the Contact: header<br>
<pre>--- src/mod/endpoints/mod_sofia/sofia_presence.c 2011-08-18 05:55:20.000000000 -0400
+++ src/mod/endpoints/mod_sofia/sofia_presence.c_tweaked 2011-08-18 05:51:04.000000000 -0400
@@ -2160,11 +2160,13 @@
}
if (to) {
- to_str = switch_mprintf("sip:%s@%s", to->a_url->url_user, to->a_url->url_host);
+ //to_str = switch_mprintf("sip:%s@%s", to->a_url->url_user, to->a_url->url_host);
+ to_str = switch_mprintf("sip:%s@%s", contact_user, to->a_url->url_host);
}
if (to) {
- to_user = to->a_url->url_user;
+ //to_user = to->a_url->url_user;
+ to_user = contact_user;
to_host = to->a_url->url_host;
}<br></pre><br>So far I haven't seen any downside of this hack.<br><br>Regards,<br>Tom<br><br><div class="gmail_quote">On Wed, Aug 17, 2011 at 6:59 PM, Michael Collins <span dir="ltr"><<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">This is interesting. I'm looking at the SIP book by Alan Johnston (one of the guys who authored the SIP spec) and I can't see any indication that the To: field can contain an invalid URI like that. <div>
<br></div><div>
Question: why, exactly, does the client feel that it needs to violate such a basic principle?</div><div><br></div><div>-MC<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Tue, Aug 16, 2011 at 7:58 AM, Lorem Ipsum <span dir="ltr"><<a href="mailto:lrmipsum0@gmail.com" target="_blank">lrmipsum0@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">Hello,<br><br>I'm testing a SIP stack for an embedded device. The device, among other things, is capable of informing a user about pending messages on the voicemail. It does that by subscribing to the message-summary. Below some wireshark traces (172.16.30.68 is my device, 172.16.31.10 is FreeSWITCH):<br>
<br>REGISTER sip:172.16.31.10 SIP/2.0<br>Via: SIP/2.0/UDP 172.16.30.68:5080;rport;branch=z9hG4bKPj051b000000035ea40edf<br>Route: <sip:172.16.31.10:5060;lr><br>Max-Forwards: 70<br>From: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=051b000000025ea40edf<br>
To: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>><br>Call-ID: 051b000000015ea40edf<br>CSeq: 1 REGISTER<br>Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY<br>
User-Agent: My_Sip_Device<br>
Contact: <<a href="http://sip:399510002@172.16.30.68:5080" target="_blank">sip:399510002@172.16.30.68:5080</a>>;transport=udp<br>Content-Length: 0<br><br>SIP/2.0 401 Unauthorized<br>Via: SIP/2.0/UDP 172.16.30.68:5080;rport=5080;branch=z9hG4bKPj051b000000035ea40edf<br>
From: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=051b000000025ea40edf<br>To: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=mQrcXUcvrtUmS<br>
Call-ID: 051b000000015ea40edf<br>CSeq: 1 REGISTER<br>User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-38e3f5f 2011-08-09 03-09-19 -0400<br>Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE<br>
Supported: timer, precondition, path, replaces<br>WWW-Authenticate: Digest realm="172.16.31.10", nonce="3139f996-c814-11e0-93d2-05aa0ee343d6", algorithm=MD5, qop="auth"<br>Content-Length: 0<br>
<br>REGISTER sip:172.16.31.10 SIP/2.0<br>Via: SIP/2.0/UDP 172.16.30.68:5080;rport;branch=z9hG4bKPj051b000000065ea40edf<br>Route: <sip:172.16.31.10:5060;lr><br>Max-Forwards: 70<br>From: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=051b000000045ea40edf<br>
To: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>><br>Call-ID: 051b000000015ea40edf<br>CSeq: 2 REGISTER<br>Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY<br>
User-Agent: My_Sip_Device<br>
Contact: <<a href="http://sip:399510002@172.16.30.68:5080" target="_blank">sip:399510002@172.16.30.68:5080</a>>;transport=udp<br>Authorization: Digest username="399510002", realm="172.16.31.10", nonce="3139f996-c814-11e0-93d2-05aa0ee343d6", uri="sip:172.16.31.10", response="1e95409a562c074cbe6df148a85107ef", algorithm=MD5, cnonce="051b000000055ea40edf", qop=auth, nc=00000001<br>
Content-Length: 0<br><br>SIP/2.0 200 OK<br>Via: SIP/2.0/UDP 172.16.30.68:5080;rport=5080;branch=z9hG4bKPj051b000000065ea40edf<br>From: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=051b000000045ea40edf<br>
To: <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=N0H5ypXZN3H7m<br>Call-ID: 051b000000015ea40edf<br>CSeq: 2 REGISTER<br>Contact: <<a href="http://sip:399510002@172.16.30.68:5080" target="_blank">sip:399510002@172.16.30.68:5080</a>>;transport=udp;expires=180<br>
Date: Tue, 16 Aug 2011 14:29:47 GMT<br>User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-38e3f5f 2011-08-09 03-09-19 -0400<br>Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE<br>
Supported: timer, precondition, path, replaces<br>Content-Length: 0<br><br><br>SUBSCRIBE sip:172.16.31.10 SIP/2.0<br>Via: SIP/2.0/UDP 172.16.30.68:5080;rport;branch=z9hG4bKPj051b0000000a5ea40edf<br>Max-Forwards: 69<br>From: "399510002" <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=051b000000085ea40edf<br>
To: <sip:172.16.31.10><br>Contact: <<a href="http://sip:399510002@172.16.30.68:5080" target="_blank">sip:399510002@172.16.30.68:5080</a>><br>Call-ID: 051b000000095ea40edf<br>CSeq: 1 SUBSCRIBE<br>Event: message-summary<br>
Accept: application/simple-message-summary<br>
Allow-Events: message-summary<br>User-Agent: My_Sip_Device<br>X-Serialnumber: LMZ091218000026<br>Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, SUBSCRIBE, NOTIFY<br>Route: <sip:172.16.31.10:5060;lr><br>Content-Length: 0<br>
<br>SIP/2.0 200 OK<br>Via: SIP/2.0/UDP 172.16.30.68:5080;rport=5080;branch=z9hG4bKPj051b0000000a5ea40edf<br>From: "399510002" <<a href="mailto:sip%3A399510002@172.16.31.10" target="_blank">sip:399510002@172.16.31.10</a>>;tag=051b000000085ea40edf<br>
To: <sip:172.16.31.10>;tag=p9ay0He3jc8Sg<br>Call-ID: 051b000000095ea40edf<br>CSeq: 1 SUBSCRIBE<br>Contact: <<a href="http://sip:@172.16.31.10:5060" target="_blank">sip:@172.16.31.10:5060</a>><br>Expires: 60<br>
User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-38e3f5f 2011-08-09 03-09-19 -0400<br>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE<br>Supported: timer, precondition, path, replaces<br>Allow-Events: talk, hold, presence, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer<br>
Subscription-State: active;expires=60<br>Content-Length: 0<br><br><br>After sending the 200 OK, FreeSWITCH does not send the NOTIFY.<br>If you look at the Contact header of the answer to the SUBSCRIBE you will notice that the part before the "@" is missing. I guess this is because SUBSCRIBE request does not contain the whole URI, just the host part. That is because our customer wants it done this way; the request line should look like this: <br>
SUBSCRIBE sip:voicemail_server SIP/2.0<br><br>and the To: header should look like this:<br>To: <sip:voicemail_server><br><br>My question is: how can I make FreeSWITCH (the NOTIFY part anyway, other things are working OK) work with such a device? Thanks.<br>
<br>Regards,<br>Tom<br>
<br><br></div></div>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>
<br><br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>