summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-02-01 20:43:49 +0000
committerOlle Johansson <oej@edvina.net>2007-02-01 20:43:49 +0000
commit0b84b386b945778d374f915729fe2700a0f80b0a (patch)
tree2762573bee73b40cc35ca0fe6d88465578d3747b /channels
parent34eaa6170005f636058f2e55c243ae49cf75311f (diff)
Implementing "busy-limit".
If you set call limit and busy limit, chan_sip will indicate BUSY for a device that has reached the busy limit and allow calls up to the call limit, allowing for call transfers (that generate a new call). If you only set call limit, chan_sip will not indicate BUSY until that limit is filled. This affects SIP subscriptions, call queues and manager applications. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5d7be1d37..24c23ab7d 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1095,6 +1095,7 @@ struct sip_peer {
int inRinging; /*!< Number of calls ringing */
int onHold; /*!< Peer has someone on hold */
int call_limit; /*!< Limit of concurrent calls */
+ int busy_limit; /*!< Limit where we signal busy */
enum transfermodes allowtransfer; /*! SIP Refer restriction scheme */
char vmexten[AST_MAX_EXTENSION]; /*!< Dialplan extension for MWI notify message*/
char mailbox[AST_MAX_EXTENSION]; /*!< Mailbox setting for MWI checks */
@@ -10207,6 +10208,8 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, const struct m
ast_cli(fd, " VM Extension : %s\n", peer->vmexten);
ast_cli(fd, " LastMsgsSent : %d/%d\n", (peer->lastmsgssent & 0x7fff0000) >> 16, peer->lastmsgssent & 0xffff);
ast_cli(fd, " Call limit : %d\n", peer->call_limit);
+ if (peer->busy_limit)
+ ast_cli(fd, " Busy limit : %d\n", peer->busy_limit);
ast_cli(fd, " Dynamic : %s\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC)?"Yes":"No"));
ast_cli(fd, " Callerid : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, "<unspecified>"));
ast_cli(fd, " MaxCallBR : %d kbps\n", peer->maxcallbitrate);
@@ -10294,7 +10297,8 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, const struct m
astman_append(s, "VoiceMailbox: %s\r\n", peer->mailbox);
astman_append(s, "TransferMode: %s\r\n", transfermode2str(peer->allowtransfer));
astman_append(s, "LastMsgsSent: %d\r\n", peer->lastmsgssent);
- astman_append(s, "Call limit: %d\r\n", peer->call_limit);
+ astman_append(s, "Call-limit: %d\r\n", peer->call_limit);
+ astman_append(s, "Busy-limit: %d\r\n", peer->busy_limit);
astman_append(s, "MaxCallBR: %d kbps\r\n", peer->maxcallbitrate);
astman_append(s, "Dynamic: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_DYNAMIC)?"Y":"N"));
astman_append(s, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, ""));
@@ -15405,6 +15409,9 @@ static int sip_devicestate(void *data)
} else if (p->call_limit && (p->inUse == p->call_limit))
/* check call limit */
res = AST_DEVICE_BUSY;
+ else if (p->call_limit && p->busy_limit && p->inUse >= p->busy_limit)
+ /* We're forcing busy before we've reached the call limit */
+ res = AST_DEVICE_BUSY;
else if (p->call_limit && p->inUse)
/* Not busy, but we do have a call */
res = AST_DEVICE_INUSE;