[asterisk-commits] mmichelson: branch 13 r434218 - /branches/13/res/res_pjsip_messaging.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 7 10:33:36 CDT 2015


Author: mmichelson
Date: Tue Apr  7 10:33:33 2015
New Revision: 434218

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434218
Log:
Do not queue message requests that we do not respond to.

If we receive a MESSAGE request that we cannot send a response
to, we should not send the incoming MESSAGE to the dialplan.

This commit should help the bouncing message_retrans test to
pass consistently.


Modified:
    branches/13/res/res_pjsip_messaging.c

Modified: branches/13/res/res_pjsip_messaging.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_messaging.c?view=diff&rev=434218&r1=434217&r2=434218
==============================================================================
--- branches/13/res/res_pjsip_messaging.c (original)
+++ branches/13/res/res_pjsip_messaging.c Tue Apr  7 10:33:33 2015
@@ -673,9 +673,16 @@
 		return PJ_TRUE;
 	}
 
-	/* send it to the messaging core */
-	ast_msg_queue(msg);
-	send_response(rdata, PJSIP_SC_ACCEPTED, NULL, NULL);
+	/* Send it to the messaging core.
+	 *
+	 * If we are unable to send a response, the most likely reason is that we
+	 * are handling a retransmission of an incoming MESSAGE and were unable to
+	 * create a transaction due to a duplicate key. If we are unable to send
+	 * a response, we should not queue the message to the dialplan
+	 */
+	if (!send_response(rdata, PJSIP_SC_ACCEPTED, NULL, NULL)) {
+		ast_msg_queue(msg);
+	}
 
 	return PJ_TRUE;
 }




More information about the asterisk-commits mailing list