]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
doh
authorMathieu Rene <mrene@avgs.ca>
Sat, 28 Mar 2009 02:16:34 +0000 (02:16 +0000)
committerMathieu Rene <mrene@avgs.ca>
Sat, 28 Mar 2009 02:16:34 +0000 (02:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12819 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_reg.c

index cfdc047d7fbb166ad2140ea2ade7a3fcffb417e5..d52c134ceb3101f68ac144e397bcccfc67cd184b 100644 (file)
@@ -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;