Hi Pascal,

We found the problem - the socket on which the Subscribe was received was always used when sending the Notify. Find attached a patch for tm module that should fix this problem. Please test and report the results.

Regards,

--
Anca Vamanu
www.voice-system.ro



Pascal Maugeri wrote:
Hi

Using opensips 1.6 we need to have the presence module to send NOTIFY over TCP rather than UDP when the size of the message is greater than a given MTU.

We tried to force it sending a SUBSCRIBE with transport=tcp in Contact header:

    SUBSCRIBE sip:[email protected]
    <mailto:sip%[email protected]> SIP/2.0
    [...]
    Contact: <sip:[email protected]:5233;transport=tcp>
    Event: presence


but the NOTIFY messages are sent over UDP (observe the "transport=tcp" in the request line):

    NOTIFY sip:[email protected]:5233;transport=tcp SIP/2.0
    [...]
    Contact: <sip:[email protected]:6667
    <http://sip:[email protected]:6667>>
    Subscription-State: active;expires=120
    Content-Type: application/pidf+xml
    Content-Length: 1254


Could you please let me know what we should do to enable the sending over TCP ? I don't understand what we're doing wrong.

Cheers
Pascal
------------------------------------------------------------------------

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Index: modules/tm/uac.c
===================================================================
--- modules/tm/uac.c	(revision 6669)
+++ modules/tm/uac.c	(working copy)
@@ -207,6 +207,7 @@
 	int ret, flags, sflag_bk;
 	int backup_route_type;
 	unsigned int hi;
+	struct socket_info* send_sock;
 
 	ret=-1;
 	
@@ -218,22 +219,27 @@
 
 	LM_DBG("next_hop=<%.*s>\n",dialog->hooks.next_hop->len,
 			dialog->hooks.next_hop->s);
-	/* it's a new message, so we will take the default socket */
-	if (dialog->send_sock) {
-		if (uri2su( dialog->hooks.next_hop, &to_su,
-		dialog->send_sock->proto)==-1) {
-			goto error2;
-		}
-	} else {
-		dialog->send_sock = uri2sock(0, dialog->hooks.next_hop, &to_su,
+
+	/* calculate the socket corresponding to next hop */
+	send_sock = uri2sock(0, dialog->hooks.next_hop, &to_su,
 			PROTO_NONE);
-		if (dialog->send_sock==0) {
-			ret=ser_error;
-			LM_ERR("no socket found\n");
-			goto error2;
-		}
+	if (dialog->send_sock==0) {
+		ret=ser_error;
+		LM_ERR("no socket found\n");
+		goto error2;
 	}
+	/* if a send socket defined verify if the same protocol */
+	if(dialog->send_sock) {
+		if(send_sock->proto == dialog->send_sock->proto)
+			send_sock = dialog->send_sock;
+	}
+	else
+	{
+		/* to keep the previous behavior when this filed was filled */
+		dialog->send_sock = send_sock;
+	}
 
+	LM_DBG("t_uac\n");
 	new_cell = build_cell(0);
 	if (!new_cell) {
 		ret=E_OUT_OF_MEM;
@@ -261,8 +267,8 @@
 
 	request = &new_cell->uac[0].request;
 	request->dst.to = to_su;
-	request->dst.send_sock = dialog->send_sock;
-	request->dst.proto = dialog->send_sock->proto;
+	request->dst.send_sock = send_sock;
+	request->dst.proto = send_sock->proto;
 	request->dst.proto_reserved1 = 0;
 
 	hi=dlg2hash(dialog);
@@ -312,7 +318,7 @@
 					"%p %p\n",req->add_rm, req->body_lumps);
 				/* build the shm buffer now */
 				buf1 = build_req_buf_from_sip_req(req,(unsigned int*)&buf_len1,
-					dialog->send_sock, dialog->send_sock->proto,
+					send_sock, send_sock->proto,
 					MSG_TRANS_SHM_FLAG|MSG_TRANS_NOVIA_FLAG );
 				if (!buf1) {
 					LM_ERR("no more shm mem\n"); 
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to