[svn-commits] mmichelson: branch mmichelson/direct_media r382666 - /team/mmichelson/direct_...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 7 17:50:28 CST 2013


Author: mmichelson
Date: Thu Mar  7 17:50:22 2013
New Revision: 382666

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382666
Log:
Register a new gulp supplement for incoming ACKs.

Now direct media reinvites are working more consistently than they
previously have.


Modified:
    team/mmichelson/direct_media/channels/chan_gulp.c

Modified: team/mmichelson/direct_media/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/direct_media/channels/chan_gulp.c?view=diff&rev=382666&r1=382665&r2=382666
==============================================================================
--- team/mmichelson/direct_media/channels/chan_gulp.c (original)
+++ team/mmichelson/direct_media/channels/chan_gulp.c Thu Mar  7 17:50:22 2013
@@ -106,6 +106,13 @@
 	.session_end = gulp_session_end,
 	.incoming_request = gulp_incoming_request,
 	.incoming_response = gulp_incoming_response,
+};
+
+static int gulp_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_data *rdata);
+
+static struct ast_sip_session_supplement gulp_ack_supplement = {
+	.method = "ACK",
+	.incoming_request = gulp_incoming_ack,
 };
 
 /*! \brief Function called by RTP engine to get local audio RTP peer */
@@ -889,11 +896,6 @@
 	int res = AST_PBX_FAILED;
 
 	if (session->channel) {
-		if (rdata->msg_info.msg->line.req.method.id == PJSIP_ACK_METHOD) {
-			if (session->endpoint->direct_media) {
-				ast_queue_control(session->channel, AST_CONTROL_SRCCHANGE);
-			}
-		}
 		return 0;
 	}
 
@@ -951,6 +953,16 @@
 	default:
 		break;
 	}
+}
+
+static int gulp_incoming_ack(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
+{
+	if (rdata->msg_info.msg->line.req.method.id == PJSIP_ACK_METHOD) {
+		if (session->endpoint->direct_media) {
+			ast_queue_control(session->channel, AST_CONTROL_SRCCHANGE);
+		}
+	}
+	return 0;
 }
 
 /*!
@@ -983,6 +995,11 @@
 		goto end;
 	}
 
+	if (ast_sip_session_register_supplement(&gulp_ack_supplement)) {
+		ast_log(LOG_ERROR, "Unable to register Gulp ACK supplement\n");
+		goto end;
+	}
+
 	return 0;
 
 end:




More information about the svn-commits mailing list