[asterisk-commits] file: branch 1.4 r43697 - /branches/1.4/channels/chan_local.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 26 13:19:34 MST 2006


Author: file
Date: Tue Sep 26 15:19:33 2006
New Revision: 43697

URL: http://svn.digium.com/view/asterisk?rev=43697&view=rev
Log:
Strip options off the argument passed for devicestate in chan_local. (issue #8034 reported by pcardozo)

Modified:
    branches/1.4/channels/chan_local.c

Modified: branches/1.4/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_local.c?rev=43697&r1=43696&r2=43697&view=diff
==============================================================================
--- branches/1.4/channels/chan_local.c (original)
+++ branches/1.4/channels/chan_local.c Tue Sep 26 15:19:33 2006
@@ -127,7 +127,7 @@
 static int local_devicestate(void *data)
 {
 	char *exten = ast_strdupa(data);
-	char *context = NULL;
+	char *context = NULL, *opts = NULL;
 	int res;
 
 	if (!(context = strchr(exten, '@'))) {
@@ -136,6 +136,10 @@
 	}
 
 	*context++ = '\0';
+
+	/* Strip options if they exist */
+	if ((opts = strchr(context, '/')))
+		*opts = '\0';
 
 	if (option_debug > 2)
 		ast_log(LOG_DEBUG, "Checking if extension %s@%s exists (devicestate)\n", exten, context);



More information about the asterisk-commits mailing list