[asterisk-commits] file: branch group/pimp_my_sip r379430 - /team/group/pimp_my_sip/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 18 09:03:57 CST 2013


Author: file
Date: Fri Jan 18 09:03:54 2013
New Revision: 379430

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379430
Log:
Send a 100 Trying so we don't get INVITE retransmissions and so SDP negotiation can occur.

Modified:
    team/group/pimp_my_sip/channels/chan_gulp.c

Modified: team/group/pimp_my_sip/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/channels/chan_gulp.c?view=diff&rev=379430&r1=379429&r2=379430
==============================================================================
--- team/group/pimp_my_sip/channels/chan_gulp.c (original)
+++ team/group/pimp_my_sip/channels/chan_gulp.c Fri Jan 18 09:03:54 2013
@@ -465,6 +465,7 @@
 /*! \brief Function called when a request is received on the session */
 static int gulp_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
 {
+	pjsip_tx_data *packet = NULL;
 	int res = AST_PBX_FAILED;
 
 	/* We only care about new sessions */
@@ -473,14 +474,20 @@
 	}
 
 	if (!(session->channel = gulp_new(session, AST_STATE_DOWN, session->exten, NULL, NULL, NULL))) {
-		pjsip_tx_data *packet = NULL;
-
 		if (pjsip_inv_end_session(session->inv_session, 503, NULL, &packet) == PJ_SUCCESS) {
 			ast_sip_session_send_response(session, packet);
 		}
 
 		return -1;
 	}
+
+	if (pjsip_inv_initial_answer(session->inv_session, rdata, 100, NULL, NULL, &packet) != PJ_SUCCESS) {
+		ast_channel_hangupcause_set(session->channel, AST_CAUSE_SWITCH_CONGESTION);
+		ast_hangup(session->channel);
+		return -1;
+	}
+
+	ast_sip_session_send_response(session, packet);
 
 	res = ast_pbx_start(session->channel);
 




More information about the asterisk-commits mailing list