diff options
author | Olle Johansson <oej@edvina.net> | 2006-11-04 19:20:30 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2006-11-04 19:20:30 +0000 |
commit | fe5440b7c855872f6b4a25538a0b33160f9007ec (patch) | |
tree | 468bfde2e58a13de41f4ac3b2f2947019a85ee62 | |
parent | d900b47ccf388849546d53e52fc7e7d3387725a8 (diff) |
Simplify previous patch
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index edbc346b1..fc596786a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3043,23 +3043,11 @@ static int update_call_counter(struct sip_pvt *fup, int event) ast_copy_string(name, fup->username, sizeof(name)); /* Check the list of users only for incoming calls */ - if (!outgoing) { - if (global_limitonpeers == FALSE && (u = find_user(name, 1))) { + if (global_limitonpeers == FALSE && !outgoing && (u = find_user(name, 1))) { inuse = &u->inUse; call_limit = &u->call_limit; inringing = NULL; - } else { - /* If limitonpeers is on, we only apply the limits to the - peer part of the type=friend. This is mainly to - help the queue system */ - p = find_peer(name, NULL, 1); /* Check the peer */ - if (p != NULL) { - inuse = &p->inUse; - call_limit = &p->call_limit; - inringing = &p->inRinging; - } - } - } else if ( (p = find_peer(fup->peername, NULL, 1) ) ) { /* Try to find peer */ + } else if ( (p = find_peer(ast_strlen_zero(fup->peername) ? name : fup->peername, NULL, 1) ) ) { /* Try to find peer */ inuse = &p->inUse; call_limit = &p->call_limit; inringing = &p->inRinging; |