]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add viles patch
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 21 Oct 2006 22:54:55 +0000 (22:54 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 21 Oct 2006 22:54:55 +0000 (22:54 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3140 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 238eb9085f06eb3bfd8ad15a4d424f2fe7e057ad..25ec7dc16b81d55ee7a938ab5708024d8abe0030 100644 (file)
@@ -3771,18 +3771,22 @@ static void sip_r_register(int status,
                return;
        }
        
-       if (sip->sip_www_authenticate) {
-               authenticate = sip->sip_www_authenticate;
-       } else if (sip->sip_proxy_authenticate) {
-               authenticate = sip->sip_proxy_authenticate;
-       }
-
        if (status == 200) {
                if (sofia_private->oreg) {
                        oreg->state = REG_STATE_REGISTER;
                        nua_handle_destroy(nh);
                }
-       } else if (authenticate) {
+       } else if (status == 401 || status == 407) {
+
+               if (sip->sip_www_authenticate) {
+                       authenticate = sip->sip_www_authenticate;
+               } else if (sip->sip_proxy_authenticate) {
+                       authenticate = sip->sip_proxy_authenticate;
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Missing Authenticate Header!\n");
+                       return;
+               }
+
                char const *realm = (char const *) *authenticate->au_params;
                char const *scheme = (char const *) authenticate->au_scheme;
                char authentication[256] = "";