]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10338: [mod_sofia] add sip_invite_stamp variable of the time we received initial...
authorMike Jerris <mike@jerris.com>
Tue, 23 May 2017 21:06:57 +0000 (17:06 -0400)
committerMike Jerris <mike@jerris.com>
Tue, 23 May 2017 21:07:08 +0000 (17:07 -0400)
src/mod/endpoints/mod_sofia/sofia.c

index a949b6f5ab6085513b40c0580db3834212cbd637..2919a129df6fae580f18fad95ebb54a965f9be47 100644 (file)
@@ -9981,6 +9981,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
        char *name_params = NULL;
        const char *req_uri = NULL;
        char *req_user = NULL;
+       switch_time_t sip_invite_time;
 
        if (sip && sip->sip_contact && sip->sip_contact->m_url->url_params) {
                uparams = sip->sip_contact->m_url->url_params;
@@ -10010,6 +10011,8 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
 
        tech_pvt = switch_core_session_get_private(session);
 
+       sip_invite_time = switch_micro_time_now();
+
        if (!sip || !sip->sip_request || !sip->sip_request->rq_method_name) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received an invalid packet!\n");
                nua_respond(nh, SIP_503_SERVICE_UNAVAILABLE, TAG_END());
@@ -10274,6 +10277,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
        switch_channel_set_variable_printf(channel, "sip_local_network_addr", "%s", profile->extsipip ? profile->extsipip : profile->sipip);
        switch_channel_set_variable_printf(channel, "sip_network_ip", "%s", network_ip);
        switch_channel_set_variable_printf(channel, "sip_network_port", "%d", network_port);
+       switch_channel_set_variable_printf(channel, "sip_invite_stamp", "%" SWITCH_TIME_T_FMT, sip_invite_time);
 
        if (*acl_token) {
                switch_channel_set_variable(channel, "acl_token", acl_token);