[asterisk-commits] mmichelson: branch mmichelson/direct_media r382879 - /team/mmichelson/direct_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 12 12:24:52 CDT 2013


Author: mmichelson
Date: Tue Mar 12 12:24:48 2013
New Revision: 382879

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382879
Log:
Fix case where sometimes we would not send direct media request to calling side.

Problem is that reception of an ACK does not trigger a transaction state change with
event TX_MSG, but rather an event USER. The fix for this is just to always queue
delayed requests when an INVITE transaction changes states to TERMINATED. We don't
care about the event that caused the transaction state change, just that it occurred.


Modified:
    team/mmichelson/direct_media/res/res_sip_session.c

Modified: team/mmichelson/direct_media/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/direct_media/res/res_sip_session.c?view=diff&rev=382879&r1=382878&r2=382879
==============================================================================
--- team/mmichelson/direct_media/res/res_sip_session.c (original)
+++ team/mmichelson/direct_media/res/res_sip_session.c Tue Mar 12 12:24:48 2013
@@ -1263,15 +1263,10 @@
 	switch (e->body.tsx_state.type) {
 	case PJSIP_EVENT_TX_MSG:
 		tsx->mod_data[session_module.id] = e->body.tsx_state.src.tdata->mod_data[session_module.id];
-		if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
-			queue_delayed_request(session);
-		}
 		break;
 	case PJSIP_EVENT_RX_MSG:
 		if (tsx->method.id == PJSIP_INVITE_METHOD) {
-			if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
-				queue_delayed_request(session);
-			} else if (tsx->role == PJSIP_ROLE_UAC && tsx->state == PJSIP_TSX_STATE_COMPLETED) {
+			if (tsx->role == PJSIP_ROLE_UAC && tsx->state == PJSIP_TSX_STATE_COMPLETED) {
 				/* This means we got a non 2XX final response to our outgoing INVITE */
 				if (tsx->status_code == PJSIP_SC_REQUEST_PENDING) {
 					reschedule_reinvite(session, tsx->mod_data[session_module.id]);
@@ -1296,6 +1291,10 @@
 		/* Inception? */
 		break;
 	}
+
+	if (tsx->method.id == PJSIP_INVITE_METHOD && tsx->state == PJSIP_TSX_STATE_TERMINATED) {
+		queue_delayed_request(session);
+	}
 }
 
 static int add_sdp_streams(void *obj, void *arg, void *data, int flags)




More information about the asterisk-commits mailing list