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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 22 14:41:17 CST 2013


Author: file
Date: Tue Jan 22 14:41:14 2013
New Revision: 379932

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379932
Log:
Handle incoming responses from outgoing sessions.

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=379932&r1=379931&r2=379932
==============================================================================
--- team/group/pimp_my_sip/channels/chan_gulp.c (original)
+++ team/group/pimp_my_sip/channels/chan_gulp.c Tue Jan 22 14:41:14 2013
@@ -656,6 +656,26 @@
 /*! \brief Function called when a response is received on the session */
 static void gulp_incoming_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
 {
+	struct pjsip_status_line status = rdata->msg_info.msg->line.status;
+
+	switch (status.code) {
+	case 180:
+		ast_queue_control(session->channel, AST_CONTROL_RINGING);
+		if (ast_channel_state(session->channel) != AST_STATE_UP) {
+			ast_setstate(session->channel, AST_STATE_RINGING);
+		}
+		break;
+	case 183:
+		ast_rtp_instance_activate(session->media.audio);
+		ast_queue_control(session->channel, AST_CONTROL_PROGRESS);
+		break;
+	case 200:
+		ast_rtp_instance_activate(session->media.audio);
+		ast_queue_control(session->channel, AST_CONTROL_ANSWER);
+		break;
+	default:
+		break;
+	}
 }
 
 /*!




More information about the asterisk-commits mailing list