From d933d5fe2f5f9f02661d40207fa7e7841b804dad Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 11 Jan 2007 23:44:18 +0000 Subject: [PATCH] add max_forwards chanvar, maybe we should put this in caller profile and allways pass it across and decrement it to avoid loops across the switch, at least for protocols that support loop detection. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3947 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 40534d1176..3369deb850 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -4149,8 +4149,10 @@ static void sip_i_invite(nua_t *nua, snprintf(uri, sizeof(uri), "%s@%s:%s", req_user, req_host, req_port); switch_channel_set_variable(channel, "sip_req_uri", uri); + snprintf(uri, sizeof(uri), "%u", sip->sip_max_forwards->mf_count); + switch_channel_set_variable(channel, "max_forwards", uri); - if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), + if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), (char *) from->a_url->url_user, profile->dialplan, displayname,