[Freeswitch-svn] [commit] r8784 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Fri Jun 6 14:24:35 EDT 2008


Author: anthm
Date: Fri Jun  6 14:24:35 2008
New Revision: 8784

Modified:
   freeswitch/trunk/src/switch_ivr_originate.c

Log:
per channel callerid

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Fri Jun  6 14:24:35 2008
@@ -729,8 +729,9 @@
 
 		for (r = 0; r < or_argc; r++) {
 			uint32_t hups;
-			char *p,*e = NULL;
-
+			char *p, *e = NULL;
+			const char *var_begin, *var_end;
+			
 			reason = SWITCH_CAUSE_UNALLOCATED;
 			memset(peer_names, 0, sizeof(peer_names));
 			peer_session = NULL;
@@ -859,6 +860,31 @@
 						myflags |= SOF_FORKED_DIAL;
 					}
 				}
+
+				if (vdata && (var_begin = switch_stristr("effective_caller_id_number=", vdata))) {
+					char tmp[512] = "";
+					var_begin += strlen("effective_caller_id_number=");
+					var_end = strchr(var_begin, '|');
+					if (var_end) {
+						strncpy(tmp, var_begin, var_end-var_begin);
+					} else {
+						strncpy(tmp, var_begin, strlen(var_begin));
+					}
+					new_profile->caller_id_number = switch_core_strdup(new_profile->pool, tmp);
+				}
+
+				if (vdata && (var_begin = switch_stristr("effective_caller_id_name=", vdata))) {
+					char tmp[512] = "";
+					var_begin += strlen("effective_caller_id_name=");
+					var_end = strchr(var_begin, '|');
+					if (var_end) {
+						strncpy(tmp, var_begin, var_end-var_begin);
+					} else {
+						strncpy(tmp, var_begin, strlen(var_begin));
+					}
+					new_profile->caller_id_name = switch_core_strdup(new_profile->pool, tmp);
+				}
+
 				if ((reason =
 					 switch_core_session_outgoing_channel(session, var_event, chan_type, new_profile, &new_session, &pool,
 														  myflags)) != SWITCH_CAUSE_SUCCESS) {



More information about the Freeswitch-svn mailing list