[asterisk-commits] branch oej/sdpcleanup r32182 - in /team/oej/sdpcleanup: ./ channels/ include/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Jun 4 22:49:50 MST 2006


Author: oej
Date: Mon Jun  5 00:49:49 2006
New Revision: 32182

URL: http://svn.digium.com/view/asterisk?rev=32182&view=rev
Log:
Reset automerge, fix initialization in add_sdp

Modified:
    team/oej/sdpcleanup/   (props changed)
    team/oej/sdpcleanup/channels/chan_sip.c
    team/oej/sdpcleanup/include/asterisk/stringfields.h

Propchange: team/oej/sdpcleanup/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/sdpcleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun  5 00:49:49 2006
@@ -1,1 +1,1 @@
-/trunk:1-32129
+/trunk:1-32181

Modified: team/oej/sdpcleanup/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sdpcleanup/channels/chan_sip.c?rev=32182&r1=32181&r2=32182&view=diff
==============================================================================
--- team/oej/sdpcleanup/channels/chan_sip.c (original)
+++ team/oej/sdpcleanup/channels/chan_sip.c Mon Jun  5 00:49:49 2006
@@ -2912,7 +2912,7 @@
 	if (ast->_state != AST_STATE_UP) {
 		needcancel = TRUE;
 		if (option_debug > 3)
-			ast_log(LOG_DEBUG, "Hanging up channel in state %s\n", ast_state2str(ast->_state));
+			ast_log(LOG_DEBUG, "Hanging up channel in state %s (not UP)\n", ast_state2str(ast->_state));
 	}
 
 	/* Disconnect */
@@ -5074,7 +5074,7 @@
 	char s[256];
 	char o[256];
 	char c[256];
-	char t[256];
+	char t[256] = "";
 	char b[256] = "";
 	char *hold;
 	char m_audio[256];
@@ -7479,23 +7479,23 @@
 
 	/* Check for arguments in the refer_to header */
 	if ((ptr = strchr(refer_to, '?'))) { /* Search for arguments */
-		*ptr = '\0';
-		ptr++;
+		*ptr++ = '\0';
 		if (!strncasecmp(ptr, "REPLACES=", 9)) {
-			char *to, *from;
+			char *to = NULL, *from = NULL;
 
 			/* This is an attended transfer */
 			referdata->attendedtransfer = 1;
 			strncpy(referdata->replaces_callid, ptr+9, sizeof(referdata->replaces_callid));
 			ast_uri_decode(referdata->replaces_callid);
-			if ((ptr = strchr(referdata->replaces_callid, ';'))) 	/* Remove options */ {
-				*ptr = '\0';
-				ptr++;
+			if ((ptr = strchr(referdata->replaces_callid, ';'))) 	/* Find options */ {
+				*ptr++ = '\0';
 			}
 
-			/* Find the different tags before we destroy the string */
-			to = strcasestr(ptr, "to-tag=");
-			from = strcasestr(ptr, "from-tag=");
+			if (ptr) {
+				/* Find the different tags before we destroy the string */
+				to = strcasestr(ptr, "to-tag=");
+				from = strcasestr(ptr, "from-tag=");
+			}
 
 			/* Grab the to header */
 			if (to) {
@@ -13644,13 +13644,9 @@
 		ext = tmp;
 	} else {
 		ext = strchr(tmp, '/');
-		if (ext) {
+		if (ext) 
 			*ext++ = '\0';
-			host = tmp;
-		} else {
-			host = tmp;
-			ext = NULL;
-		}
+		host = tmp;
 	}
 
 	if (create_addr(p, host)) {

Modified: team/oej/sdpcleanup/include/asterisk/stringfields.h
URL: http://svn.digium.com/view/asterisk/team/oej/sdpcleanup/include/asterisk/stringfields.h?rev=32182&r1=32181&r2=32182&view=diff
==============================================================================
--- team/oej/sdpcleanup/include/asterisk/stringfields.h (original)
+++ team/oej/sdpcleanup/include/asterisk/stringfields.h Mon Jun  5 00:49:49 2006
@@ -47,7 +47,7 @@
   
   sample = calloc(1, sizeof(*sample));
   if (sample) {
-	  if (!ast_string_field_init(sample)) {
+	  if (!ast_string_field_init(sample, 256)) {
 		  free(sample);
 		  sample = NULL;
 	  }



More information about the asterisk-commits mailing list