From 761be4c3956ee1ab0d80b713faa6c1b19a646dda Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sat, 28 Mar 2009 02:16:34 +0000 Subject: [PATCH] doh git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12819 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_reg.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index cfdc047d7f..d52c134ceb 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1371,9 +1371,14 @@ void sofia_reg_handle_sip_r_challenge(int status, int ss_state; sofia_gateway_t *var_gateway = NULL; const char *gw_name = NULL; - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *sip_auth_username = switch_channel_get_variable(channel, "sip_auth_username"); - const char *sip_auth_password = switch_channel_get_variable(channel, "sip_auth_password"); + switch_channel_t *channel = NULL; + const char *sip_auth_username = NULL; + const char *sip_auth_password = NULL; + + if ((channel = switch_core_session_get_channel(session)) { + sip_auth_username = switch_channel_get_variable(channel, "sip_auth_username"); + sip_auth_password = switch_channel_get_variable(channel, "sip_auth_password"); + } if (sofia_private && *sofia_private->auth_gateway_name) { gw_name = sofia_private->auth_gateway_name;