]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add ani and aniii to caller profile (MODSOFIA-34)
authorMichael Jerris <mike@jerris.com>
Sat, 21 Nov 2009 06:40:38 +0000 (06:40 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 21 Nov 2009 06:40:38 +0000 (06:40 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15596 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 84b0b36ca43c99ae35c829471dd2e9bce91d0dbc..f54133325f797d10c4254bec361ccca404ad820d 100644 (file)
@@ -5035,6 +5035,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        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 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        }
 
        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 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        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) {