Revision
17500
Author
anthm
Date
2010-05-06 15:25:30 -0500 (Thu, 06 May 2010)

Log Message

sip_acl_authed_by and sip_acl_token vars to tell when you are authed by an acl

Modified Paths

Diff

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


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-05-06 20:32:14 UTC (rev 17499)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-05-06 20:25:30 UTC (rev 17500)
@@ -5830,6 +5830,10 @@
 			if (sofia_test_pflag(profile, PFLAG_AUTH_CALLS)) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP %s Approved by acl \"%s[%s]\". Access Granted.\n",
 								  network_ip, switch_str_nil(last_acl), acl_token);
+				switch_channel_set_variable(channel, "sip_acl_authed_by", last_acl);
+				if (token) {
+					switch_channel_set_variable(channel, "sip_acl_token", acl_token);
+				}
 				is_auth = 1;
 			}
 		} else {
@@ -5888,6 +5892,10 @@
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP %s Approved by acl \"%s[%s]\". Access Granted.\n",
 									  proxied_client_ip, switch_str_nil(last_acl), acl_token);
 					is_auth = 1;
+					switch_channel_set_variable(channel, "sip_acl_authed_by", last_acl);
+					if (token) {
+						switch_channel_set_variable(channel, "sip_acl_token", acl_token);
+					}
 				}
 			}
 		}