Revision
15596
Author
mikej
Date
2009-11-21 00:40:38 -0600 (Sat, 21 Nov 2009)

Log Message

add ani and aniii to caller profile (MODSOFIA-34)

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15595 => 15596)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-11-21 06:18:56 UTC (rev 15595)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-11-21 06:40:38 UTC (rev 15596)
@@ -5035,6 +5035,7 @@
 	int is_auth = 0, calling_myself = 0;
 	int network_port = 0;
 	char *is_nat = NULL;
+	char *aniii = NULL;
 	char acl_token[512] = "";
 	sofia_transport_t transport;
 	const char *gw_name = NULL;
@@ -5294,9 +5295,16 @@
 	}
 
 	if (sip->sip_from && sip->sip_from->a_url) {
+		char * tmp;
 		from_user = sip->sip_from->a_url->url_user;
 		from_host = sip->sip_from->a_url->url_host;
 		channel_name = url_set_chanvars(session, sip->sip_from->a_url, sip_from);
+		if (sip->sip_from->a_url->url_params && (tmp = sofia_glue_find_parameter(sip->sip_from->a_url->url_params, "isup-oli="))) {
+			aniii = switch_core_session_strdup(session, tmp + 9);
+			if ((tmp = strchr(aniii, ';'))) {
+				tmp = '\0';
+			}
+		}
 
 		if (!zstr(from_user)) {
 			if (*from_user == '+') {
@@ -5725,7 +5733,7 @@
 	tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
 														 from_user,
 														 dialplan,
-														 displayname, from_user, network_ip, NULL, NULL, NULL, MODNAME, context, destination_number);
+														 displayname, from_user, network_ip, from_user, aniii, NULL, MODNAME, context, destination_number);
 
 	if (tech_pvt->caller_profile) {