SIP: Fix incoming re-invite
authorAndreas Eversberg <jolly@eversberg.eu>
Sat, 29 Sep 2018 19:22:21 +0000 (21:22 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Sat, 29 Sep 2018 19:22:21 +0000 (21:22 +0200)
sip.cpp

diff --git a/sip.cpp b/sip.cpp
index 3bd4fdf..43922fa 100644 (file)
--- a/sip.cpp
+++ b/sip.cpp
@@ -1851,7 +1851,7 @@ void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag
        PDEBUG(DEBUG_SIP, "invite received (%s->%s)\n", from, to);
 
        sip_trace_header(this, inst->interface_name, "Authorization", DIRECTION_IN);
        PDEBUG(DEBUG_SIP, "invite received (%s->%s)\n", from, to);
 
        sip_trace_header(this, inst->interface_name, "Authorization", DIRECTION_IN);
-       if (inst->auth_realm[0] || p_state != PORT_STATE_IDLE) {
+       if (inst->auth_realm[0] && p_state == PORT_STATE_IDLE) {
                /* only authenticate remote, if we have a realm set and we don't have re-invite */
                authorization = sip->sip_proxy_authorization;
                status = check_authorization(authorization, "INVITE", inst->auth_user, inst->auth_password, inst->auth_realm, inst->auth_nonce, &auth_text);
                /* only authenticate remote, if we have a realm set and we don't have re-invite */
                authorization = sip->sip_proxy_authorization;
                status = check_authorization(authorization, "INVITE", inst->auth_user, inst->auth_password, inst->auth_realm, inst->auth_nonce, &auth_text);