aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-09 06:00:18 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-09 06:00:18 +0000
commita5b75bca3546f01dbcf717e036fb85da8a8a8a88 (patch)
tree55b729e56a44996fffed585a06617bfd8b0602ac /channels/chan_iax2.c
parentfe1433baf16899179f3c88d94b825af48b000880 (diff)
Sun Mar 9 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@636 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rwxr-xr-xchannels/chan_iax2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 03cc83393..a30403833 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -830,7 +830,7 @@ static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short
static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new)
{
- int res = -1;
+ int res = 0;
int x;
int start;
if (new <= NEW_ALLOW) {
@@ -852,7 +852,7 @@ static int find_callno(unsigned short callno, unsigned short dcallno, struct soc
for (x = ((nextcallno + 1) % (AST_IAX2_MAX_CALLS - 1)) + 1; iaxs[x] && (x != start); x = (x + 1) % AST_IAX2_MAX_CALLS)
if (x == start) {
ast_log(LOG_WARNING, "Unable to accept more calls\n");
- return -1;
+ return 0;
}
ast_pthread_mutex_lock(&iaxsl[x]);
iaxs[x] = new_iax();
@@ -873,7 +873,7 @@ static int find_callno(unsigned short callno, unsigned short dcallno, struct soc
strncpy(iaxs[x]->accountcode, accountcode, sizeof(iaxs[x]->accountcode)-1);
} else {
ast_log(LOG_WARNING, "Out of resources\n");
- return -1;
+ return 0;
}
res = x;
nextcallno = x;
@@ -4270,7 +4270,7 @@ static int iax2_do_register(struct iax2_registry *reg)
if (option_debug)
ast_log(LOG_DEBUG, "Allocate call number\n");
reg->callno = find_callno(0, 0, &reg->addr, NEW_FORCE);
- if (reg->callno < 0) {
+ if (reg->callno < 1) {
ast_log(LOG_WARNING, "Unable to create call for registration\n");
return -1;
} else if (option_debug)
@@ -4322,7 +4322,7 @@ static int iax2_poke_peer(struct iax2_peer *peer)
iax2_destroy(peer->callno);
}
peer->callno = find_callno(0, 0, &peer->addr, NEW_FORCE);
- if (peer->callno < 0) {
+ if (peer->callno < 1) {
ast_log(LOG_WARNING, "Unable to allocate call for poking peer '%s'\n", peer->name);
return -1;
}
@@ -4374,7 +4374,7 @@ static struct ast_channel *iax2_request(char *type, int format, void *data)
return NULL;
}
callno = find_callno(0, 0, &sin, NEW_FORCE);
- if (callno < 0) {
+ if (callno < 1) {
ast_log(LOG_WARNING, "Unable to create call\n");
return NULL;
}