Revision
16526
Author
anthm
Date
2010-01-27 16:27:26 -0600 (Wed, 27 Jan 2010)

Log Message

add leading m:<delim>: to change delim on inline dp eg m:^:set:foo=bar^set=blah=true to put an end to Vagabond's suffering

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (16525 => 16526)


--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2010-01-27 21:08:11 UTC (rev 16525)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2010-01-27 22:27:26 UTC (rev 16526)
@@ -46,6 +46,7 @@
 	int x = 0;
 	char *lbuf;
 	char *target = arg;
+	char delim = ',';
 
 	if (!caller_profile) {
 		caller_profile = switch_channel_get_caller_profile(channel);
@@ -59,13 +60,20 @@
 		target = caller_profile->destination_number;
 	}
 
-	if (!zstr(target) && (lbuf = switch_core_session_strdup(session, target))
-		&& (argc = switch_separate_string(lbuf, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
+
+	if (zstr(target)) {
+		return NULL;
 	} else {
-		return NULL;
+		lbuf = switch_core_session_strdup(session, target);
 	}
 
+	if (*lbuf == 'm' && *(lbuf + 1) == ':' && *(lbuf + 3) == ':') {
+		delim = *(lbuf + 2);
+		lbuf += 4;
+	}
 
+	argc = switch_separate_string(lbuf, delim, argv, (sizeof(argv) / sizeof(argv[0])));
+
 	for (x = 0; x < argc; x++) {
 		char *app = argv[x];
 		char *data = strchr(app, ':');