[Freeswitch-svn] [commit] r5578 - freeswitch/trunk/src/mod/endpoints/mod_wanpipe

Freeswitch SVN anthm at freeswitch.org
Wed Aug 8 10:37:20 EDT 2007


Author: anthm
Date: Wed Aug  8 10:37:19 2007
New Revision: 5578

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c

Log:
add context option

Modified: freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c	Wed Aug  8 10:37:19 2007
@@ -116,6 +116,7 @@
 	int configured_spans;
 	int configured_boost_spans;
 	char *dialplan;
+	char *context;
 	switch_hash_t *call_hash;
 	switch_mutex_t *hash_mutex;
 	switch_mutex_t *channel_mutex;
@@ -387,6 +388,16 @@
 	globals.dialplan = strdup(dialplan);
 }
 
+static void set_global_context(char *context)
+{
+	if (globals.context) {
+		free(globals.context);
+		globals.context = NULL;
+	}
+
+	globals.context = strdup(context);
+}
+
 
 static int str2node(char *node)
 {
@@ -446,6 +457,7 @@
 
 
 static void set_global_dialplan(char *dialplan);
+static void set_global_context(char *context);
 static int str2node(char *node);
 static int str2switch(char *swtype);
 static switch_status_t wanpipe_on_init(switch_core_session_t *session);
@@ -1546,7 +1558,7 @@
 																  NULL,
 																  NULL,
 																  (char *)modname,
-																  NULL,
+																  globals.context,
 																  pevent->ring.callednum))) {
 			switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
 		}
@@ -2225,6 +2237,8 @@
 				globals.dtmf_off = atoi(val);
 			} else if (!strcmp(var, "dialplan")) {
 				set_global_dialplan(val);
+			} else if (!strcmp(var, "context")) {
+				set_global_context(val);
 			} else if (!strcmp(var, "suppress-dtmf-tone")) {
 				globals.suppress_dtmf_tone = switch_true(val);
 			} else if (!strcmp(var, "ignore-dtmf-tone")) {



More information about the Freeswitch-svn mailing list