From 321e9a39a7c0451962891b1389e1d510756907e2 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 24 Jan 2008 22:09:39 +0000 Subject: [PATCH] add lookup params to allow sip auth from remote authenticator (like radius) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7349 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_reg.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 1cb9569f62..c5c352b5f0 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -857,9 +857,18 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co switch_event_create(¶ms, SWITCH_EVENT_MESSAGE); switch_assert(params); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", "sip_auth"); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile", profile->name); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "user_agent", (sip && sip->sip_user_agent) ? sip->sip_user_agent->g_string : "unknown"); - + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_profile", profile->name); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_user_agent", (sip && sip->sip_user_agent) ? sip->sip_user_agent->g_string : "unknown"); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_username", username); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_realm", realm); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_nonce", nonce); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_uri", uri); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_qop", qop); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_cnonce", cnonce); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_response", response); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_nc", nc); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_method", (sip && sip->sip_request) ? sip->sip_request->rq_method_name : NULL); + if (!switch_strlen_zero(profile->reg_domain)) { domain_name = profile->reg_domain;