mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +00:00
Don't get stuck looping when looking for CRV's
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -6413,11 +6413,13 @@ static struct ast_channel *zt_request(char *type, int format, void *data)
|
|||||||
int trunkgroup;
|
int trunkgroup;
|
||||||
struct zt_pri *pri=NULL;
|
struct zt_pri *pri=NULL;
|
||||||
#endif
|
#endif
|
||||||
struct zt_pvt *exit;
|
struct zt_pvt *exit, *start, *end;
|
||||||
ast_mutex_t *lock;
|
ast_mutex_t *lock;
|
||||||
|
|
||||||
/* Assume we're locking the iflock */
|
/* Assume we're locking the iflock */
|
||||||
lock = &iflock;
|
lock = &iflock;
|
||||||
|
start = iflist;
|
||||||
|
end = ifend;
|
||||||
/* We do signed linear */
|
/* We do signed linear */
|
||||||
oldformat = format;
|
oldformat = format;
|
||||||
format &= (AST_FORMAT_SLINEAR | AST_FORMAT_ULAW);
|
format &= (AST_FORMAT_SLINEAR | AST_FORMAT_ULAW);
|
||||||
@@ -6481,6 +6483,8 @@ static struct ast_channel *zt_request(char *type, int format, void *data)
|
|||||||
if (pris[x].trunkgroup == trunkgroup) {
|
if (pris[x].trunkgroup == trunkgroup) {
|
||||||
pri = pris + x;
|
pri = pris + x;
|
||||||
lock = &pri->lock;
|
lock = &pri->lock;
|
||||||
|
start = pri->crvs;
|
||||||
|
end = pri->crvend;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6588,11 +6592,11 @@ next:
|
|||||||
if (backwards) {
|
if (backwards) {
|
||||||
p = p->prev;
|
p = p->prev;
|
||||||
if (!p)
|
if (!p)
|
||||||
p = ifend;
|
p = end;
|
||||||
} else {
|
} else {
|
||||||
p = p->next;
|
p = p->next;
|
||||||
if (!p)
|
if (!p)
|
||||||
p = iflist;
|
p = start;
|
||||||
}
|
}
|
||||||
/* stop when you roll to the one that we started from */
|
/* stop when you roll to the one that we started from */
|
||||||
if (p == exit)
|
if (p == exit)
|
||||||
|
Reference in New Issue
Block a user