]> 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>
Thu, 1 Jun 2017 20:18:44 +0000 (16:18 -0400)
src/mod/endpoints/mod_sofia/sofia.c

index 0f940d98dd6034eb96822ccc48178cbd644a2897..5a3deb1f2d55d4ffad472377023a208f0a9f1fff 100644 (file)
@@ -9787,6 +9787,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;
@@ -9816,6 +9817,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());
@@ -10079,6 +10082,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);