Release peer/user determination when insecure = yes
authorMark Spencer <markster@digium.com>
Fri, 2 May 2003 02:37:57 +0000 (02:37 +0000)
committerMark Spencer <markster@digium.com>
Fri, 2 May 2003 02:37:57 +0000 (02:37 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@950 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 4a5270d..74ae10c 100755 (executable)
@@ -3386,7 +3386,8 @@ static int check_user(struct sip_pvt *p, struct sip_request *req, char *cmd, cha
                ast_pthread_mutex_lock(&peerl.lock);
                peer = peerl.peers;
                while(peer) {
                ast_pthread_mutex_lock(&peerl.lock);
                peer = peerl.peers;
                while(peer) {
-                       if (!inaddrcmp(&peer->addr, &p->recv)) {
+                       if (!inaddrcmp(&peer->addr, &p->recv) || 
+                               (p->insecure && (peer->addr.sin_addr.s_addr == p->recv.sin_addr.s_addr))) {
                                /* Take the peer */
                                p->nat = peer->nat;
                                if (p->rtp) {
                                /* Take the peer */
                                p->nat = peer->nat;
                                if (p->rtp) {