[svn-commits] anthonyl: branch anthonyl/8350-codec-2 r47800 - in /team/anthonyl/8350-codec-...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Nov 17 11:23:26 MST 2006


Author: anthonyl
Date: Fri Nov 17 12:23:26 2006
New Revision: 47800

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47800
Log:
a small amount of logging

Modified:
    team/anthonyl/8350-codec-2/channels/chan_sip.c
    team/anthonyl/8350-codec-2/main/channel.c

Modified: team/anthonyl/8350-codec-2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/8350-codec-2/channels/chan_sip.c?view=diff&rev=47800&r1=47799&r2=47800
==============================================================================
--- team/anthonyl/8350-codec-2/channels/chan_sip.c (original)
+++ team/anthonyl/8350-codec-2/channels/chan_sip.c Fri Nov 17 12:23:26 2006
@@ -2863,7 +2863,8 @@
 	struct varshead *headp;
 	struct ast_var_t *current;
 	const char *referer = NULL;   /* SIP refererer */	
-
+	char codec_buf[BUFSIZ];
+	
 	p = ast->tech_pvt;
 	if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
 		ast_log(LOG_WARNING, "sip_call called on %s, neither down nor reserved\n", ast->name);
@@ -2922,7 +2923,7 @@
 
 	p->callingpres = ast->cid.cid_pres;
 	p->jointcapability = ast_translate_available_formats(p->capability, p->prefcodec);
-	
+	ast_log(LOG_DEBUG,"jointcapability %s\n",  ast_getformatname_multiple(codec_buf, BUFSIZ, p->jointcapability)); 	
 	/* If there are no audio formats left to offer, punt */
 	if (!(p->jointcapability & AST_FORMAT_AUDIO_MASK)) {
 		ast_log(LOG_WARNING, "No audio format found to offer. Cancelling call to %s\n", p->username);
@@ -6314,6 +6315,7 @@
 				 &m_audio_next, &m_audio_left,
 				 &a_audio_next, &a_audio_left,
 				 debug, &min_audio_packet_size);
+		ast_log(LOG_DEBUG,"added pref codec (%x) to sdp\n", codec);
 		alreadysent |= codec;
 	}
 
@@ -6325,16 +6327,19 @@
 		if (alreadysent & x)	/* Already added to SDP */
 			continue;
 
-		if (x <= AST_FORMAT_MAX_AUDIO)
+		if (x <= AST_FORMAT_MAX_AUDIO) {
 			add_codec_to_sdp(p, x, SDP_SAMPLE_RATE(x),
 					 &m_audio_next, &m_audio_left,
 					 &a_audio_next, &a_audio_left,
 					 debug, &min_audio_packet_size);
-		else 
+			ast_log(LOG_DEBUG,"added common codec (%x) to sdp\n",x);
+		}
+		else { 
 			add_codec_to_sdp(p, x, 90000,
 					 &m_video_next, &m_video_left,
 					 &a_video_next, &a_video_left,
 					 debug, &min_video_packet_size);
+		}
 	}
 
 	/* Now add DTMF RFC2833 telephony-event as a codec */
@@ -15264,6 +15269,7 @@
 	char *ext, *host;
 	char tmp[256];
 	char *dest = data;
+	char buf[BUFSIZ];
 
 	oldformat = format;
 	if (!(format &= ((AST_FORMAT_MAX_AUDIO << 1) - 1))) {
@@ -15271,7 +15277,7 @@
 		*cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;	/* Can't find codec to connect to host */
 		return NULL;
 	}
-	if (option_debug)
+	/* if (option_debug) uncomment me later */
 		ast_log(LOG_DEBUG, "Asked to create a SIP channel with formats: %s\n", ast_getformatname_multiple(tmp, sizeof(tmp), oldformat));
 
 	if (!(p = sip_alloc(NULL, NULL, 0, SIP_INVITE))) {
@@ -15326,6 +15332,11 @@
 	printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "<none>", host);
 #endif
 	p->prefcodec = oldformat;				/* Format for this call */
+	
+        /* again remove me! */
+	ast_verbose("sip_request_call: we are setting prefcodec to  %s\n",
+					                                ast_getformatname_multiple(buf, BUFSIZ, oldformat));
+			
 	sip_pvt_lock(p);
 	tmpc = sip_new(p, AST_STATE_DOWN, host);	/* Place the call */
 	sip_pvt_unlock(p);

Modified: team/anthonyl/8350-codec-2/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/8350-codec-2/main/channel.c?view=diff&rev=47800&r1=47799&r2=47800
==============================================================================
--- team/anthonyl/8350-codec-2/main/channel.c (original)
+++ team/anthonyl/8350-codec-2/main/channel.c Fri Nov 17 12:23:26 2006
@@ -2878,7 +2878,8 @@
 	int res;
 	int foo;
 	int videoformat = format & AST_FORMAT_VIDEO_MASK;
-
+	char buf[BUFSIZ];
+	
 	if (!cause)
 		cause = &foo;
 	*cause = AST_CAUSE_NOTDEFINED;
@@ -2893,10 +2894,19 @@
 			continue;
 
 		capabilities = chan->tech->capabilities;
+		
+		/* a little bit of logging for personal debugging, to be rm'd */
+		ast_verbose("ast_request:  tech: %s capabilities are %s\n", type, 
+				ast_getformatname_multiple(buf, BUFSIZ, capabilities));
+
+		/* again remove me! */
+		ast_verbose("ast_request: request for format %s\n",
+				ast_getformatname_multiple(buf, BUFSIZ, format));
+				
 		fmt = format & AST_FORMAT_AUDIO_MASK;
 		res = ast_translator_best_choice(&fmt, &capabilities);
 		if (res < 0) {
-			ast_log(LOG_WARNING, "No translator path exists for channel type %s (native %d) to %d\n", type, chan->tech->capabilities, format);
+			ast_log(LOG_WARNING, "No translator path exists  for (%d) to %d\n",  chan->tech->capabilities, format);
 			AST_LIST_UNLOCK(&channels);
 			return NULL;
 		}
@@ -2904,6 +2914,7 @@
 		if (!chan->tech->requester)
 			return NULL;
 		
+		/* i'm not quite sure as to why it's OR'd aginst capabilities here */
 		if (!(c = chan->tech->requester(type, capabilities | videoformat, data, cause)))
 			return NULL;
 		



More information about the svn-commits mailing list