issue #5815
authorRussell Bryant <russell@russellbryant.com>
Mon, 21 Nov 2005 13:04:36 +0000 (13:04 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 21 Nov 2005 13:04:36 +0000 (13:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7166 65c4cc65-6c06-0410-ace0-fbb531ad65f3

ChangeLog
channels/chan_iax2.c

index 05f6817..18e023d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2005-11-20  Russell Bryant <russell@digium.com>
+2005-11-21  Russell Bryant  <russell@digium.com>
+
+       * channels/chan_iax2.c (iax2_getpeername): Return non-zero to indicate that a peer was found when using realtime (issue #5815)
+
+2005-11-20  Russell Bryant  <russell@digium.com>
 
        * Makefile apps/Makefile: Fix 'make install' for Solaris. (issue #5775)
 
index 1c3c0b3..3046c61 100755 (executable)
@@ -859,10 +859,11 @@ static int iax2_getpeername(struct sockaddr_in sin, char *host, int len, int loc
 {
        struct iax2_peer *peer;
        int res = 0;
+
        if (lockpeer)
                ast_mutex_lock(&peerl.lock);
        peer = peerl.peers;
-       while(peer) {
+       while (peer) {
                if ((peer->addr.sin_addr.s_addr == sin.sin_addr.s_addr) &&
                                (peer->addr.sin_port == sin.sin_port)) {
                                        ast_copy_string(host, peer->name, len);
@@ -879,8 +880,10 @@ static int iax2_getpeername(struct sockaddr_in sin, char *host, int len, int loc
                        ast_copy_string(host, peer->name, len);
                        if (ast_test_flag(peer, IAX_TEMPONLY))
                                destroy_peer(peer);
+                       res = 1;
                }
        }
+
        return res;
 }