[asterisk-commits] file: branch group/pimp_my_sip r379270 - /team/group/pimp_my_sip/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 16 13:43:52 CST 2013


Author: file
Date: Wed Jan 16 13:43:49 2013
New Revision: 379270

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379270
Log:
Tweak return values and begin implementing SDP stream creation code.

Modified:
    team/group/pimp_my_sip/res/res_sip_sdp_audio.c

Modified: team/group/pimp_my_sip/res/res_sip_sdp_audio.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_sdp_audio.c?view=diff&rev=379270&r1=379269&r2=379270
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_sdp_audio.c (original)
+++ team/group/pimp_my_sip/res/res_sip_sdp_audio.c Wed Jan 16 13:43:49 2013
@@ -87,7 +87,7 @@
 /*! \brief Function which handles an incoming 'audio' stream */
 static int audio_handle_incoming_sdp_stream_offer(struct ast_sip_session *session, struct pjmedia_sdp_media *stream)
 {
-	int res = 0, addrs_cnt, format, othercapability = 0;
+	int res = 1, addrs_cnt, format, othercapability = 0;
 	char host[NI_MAXHOST];
 	struct ast_sockaddr *addrs;
 	struct ast_rtp_codecs codecs;
@@ -106,7 +106,7 @@
 
 	/* Create an RTP instance if need be */
 	if (!session->media.audio && audio_create_rtp(session)) {
-		return 1;
+		return -1;
 	}
 
 	/* For now use stream level connection details - once the SDP itself is passed in we can use it if not present */
@@ -188,7 +188,16 @@
 /*! \brief Function which creates an outgoing 'audio' stream */
 static int audio_create_outgoing_sdp_stream(struct ast_sip_session *session, struct pjmedia_sdp_session *sdp)
 {
-	return 0;
+	if (!ast_format_cap_has_type(session->endpoint->codecs, AST_FORMAT_TYPE_AUDIO)) {
+		/* If no audio formats are configured don't add a stream */
+		return 0;
+	} else if (!session->media.audio && audio_create_rtp(session)) {
+		return -1;
+	}
+
+
+
+	return 1;
 }
 
 /*!




More information about the asterisk-commits mailing list