[Freeswitch-svn] [commit] r3456 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Sat Nov 25 11:52:35 EST 2006


Author: anthm
Date: Sat Nov 25 11:52:35 2006
New Revision: 3456

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c

Log:
add sip_authorized variable

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Sat Nov 25 11:52:35 2006
@@ -4275,6 +4275,9 @@
 	if ((profile->pflags & PFLAG_AUTH_ALL) && tech_pvt && tech_pvt->key && sip) {
 		sip_authorization_t const *authorization = NULL;
 
+		switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
+		assert(channel != NULL);
+
 		if (sip->sip_authorization) {
 			authorization = sip->sip_authorization;
 		} else if (sip->sip_proxy_authorization) {
@@ -4286,10 +4289,13 @@
 		}
 
 		if (auth_res != AUTH_OK) {
-			switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
 			switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 			nua_respond(nh, SIP_401_UNAUTHORIZED, TAG_END());
 			goto done;
+		}
+
+		if (session) {
+			switch_channel_set_variable(channel, "sip_authorized", "true");
 		}
 	}
 



More information about the Freeswitch-svn mailing list