[asterisk-commits] trunk r18057 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Apr 6 14:18:16 MST 2006


Author: oej
Date: Thu Apr  6 16:18:12 2006
New Revision: 18057

URL: http://svn.digium.com/view/asterisk?rev=18057&view=rev
Log:
Small changes to parse_sip_options

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=18057&r1=18056&r2=18057&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Apr  6 16:18:12 2006
@@ -1061,15 +1061,16 @@
 	char *next, *sep;
 	char *temp = ast_strdupa(supported);
 	unsigned int profile = 0;
-
-	if (ast_strlen_zero(supported) )
+	int i, found;
+
+	if (!pvt || ast_strlen_zero(supported) )
 		return 0;
 
 	if (option_debug > 2 && sipdebug)
 		ast_log(LOG_DEBUG, "Begin: parsing SIP \"Supported: %s\"\n", supported);
 
 	for (next = temp; next; next = sep) {
-		int i, found = 0;
+		found = FALSE;
 		if ( (sep = strchr(next, ',')) != NULL)
 			*sep++ = '\0';
 		next = ast_skip_blanks(next);
@@ -1078,7 +1079,7 @@
 		for (i=0; i < (sizeof(sip_options) / sizeof(sip_options[0])); i++) {
 			if (!strcasecmp(next, sip_options[i].text)) {
 				profile |= sip_options[i].id;
-				found = 1;
+				found = TRUE;
 				if (option_debug > 2 && sipdebug)
 					ast_log(LOG_DEBUG, "Matched SIP option: %s\n", next);
 				break;
@@ -1087,11 +1088,8 @@
 		if (!found && option_debug > 2 && sipdebug)
 			ast_log(LOG_DEBUG, "Found no match for SIP option: %s (Please file bug report!)\n", next);
 	}
-	if (pvt) {
-		pvt->sipoptions = profile;
-		if (option_debug)
-			ast_log(LOG_DEBUG, "* SIP extension value: %d for call %s\n", profile, pvt->callid);
-	}
+
+	pvt->sipoptions = profile;
 	return profile;
 }
 



More information about the asterisk-commits mailing list