[asterisk-commits] mmichelson: trunk r434219 - in /trunk: ./ res/res_pjsip_messaging.c

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


Author: mmichelson
Date: Tue Apr  7 10:34:53 2015
New Revision: 434219

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434219
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.
........

Merged revisions 434218 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_messaging.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/res/res_pjsip_messaging.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_messaging.c?view=diff&rev=434219&r1=434218&r2=434219
==============================================================================
--- trunk/res/res_pjsip_messaging.c (original)
+++ trunk/res/res_pjsip_messaging.c Tue Apr  7 10:34:53 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