mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	rename busy-limit to busy-level, since it is not a limit
actually parse the busy-limit option from sip.conf, instead of ignoring it git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -1096,7 +1096,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 */
 | 
			
		||||
	int busy_level;			/*!< Level of active channels 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 */
 | 
			
		||||
@@ -10220,8 +10220,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);
 | 
			
		||||
		if (peer->busy_level)
 | 
			
		||||
			ast_cli(fd, "  Busy limit   : %d\n", peer->busy_level);
 | 
			
		||||
		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);
 | 
			
		||||
@@ -10310,7 +10310,7 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, const struct m
 | 
			
		||||
		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, "Busy-limit: %d\r\n", peer->busy_limit);
 | 
			
		||||
		astman_append(s, "Busy-level: %d\r\n", peer->busy_level);
 | 
			
		||||
		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, ""));
 | 
			
		||||
@@ -15428,7 +15428,7 @@ 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)
 | 
			
		||||
			else if (p->call_limit && p->busy_level && p->inUse >= p->busy_level)
 | 
			
		||||
				/* We're forcing busy before we've reached the call limit */
 | 
			
		||||
				res = AST_DEVICE_BUSY;
 | 
			
		||||
			else if (p->call_limit && p->inUse)
 | 
			
		||||
@@ -16185,6 +16185,10 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
 | 
			
		||||
			peer->call_limit = atoi(v->value);
 | 
			
		||||
			if (peer->call_limit < 0)
 | 
			
		||||
				peer->call_limit = 0;
 | 
			
		||||
		} else if (!strcasecmp(v->name, "busy-level")) {
 | 
			
		||||
			peer->busy_level = atoi(v->value);
 | 
			
		||||
			if (peer->busy_level < 0)
 | 
			
		||||
				peer->busy_level = 0;
 | 
			
		||||
		} else if (!strcasecmp(v->name, "amaflags")) {
 | 
			
		||||
			format = ast_cdr_amaflags2int(v->value);
 | 
			
		||||
			if (format < 0) {
 | 
			
		||||
 
 | 
			
		||||
@@ -195,8 +195,8 @@ srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 | 
			
		||||
; for a device. When the call limit is filled, we will indicate busy. Note that
 | 
			
		||||
; you need at least 2 in order to be able to do attended transfers.
 | 
			
		||||
;
 | 
			
		||||
; If you set the busy-limit in addition to the call limit, we will indicate busy
 | 
			
		||||
; when we have a number of calls that matches busy-limit, but still allow calls
 | 
			
		||||
; If you set the busy-level in addition to the call limit, we will indicate busy
 | 
			
		||||
; when we have a number of calls that matches busy-level, but still allow calls
 | 
			
		||||
; up to the call-limit. This allows for transfers while still having blinking
 | 
			
		||||
; lamps and queues understanding that a device is busy.
 | 
			
		||||
;
 | 
			
		||||
@@ -502,7 +502,7 @@ srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 | 
			
		||||
; videosupport		      videosupport
 | 
			
		||||
; maxcallbitrate	      maxcallbitrate
 | 
			
		||||
; rfc2833compensate           mailbox
 | 
			
		||||
;			      busy-limit
 | 
			
		||||
;			      busy-level
 | 
			
		||||
;                             username
 | 
			
		||||
;                             template
 | 
			
		||||
;                             fromdomain
 | 
			
		||||
@@ -536,7 +536,7 @@ srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 | 
			
		||||
;host=box.provider.com
 | 
			
		||||
;usereqphone=yes			; This provider requires ";user=phone" on URI
 | 
			
		||||
;call-limit=5				; permit only 5 simultaneous outgoing calls to this peer
 | 
			
		||||
;busy-limit=2				; Signal busy at 2 or more calls
 | 
			
		||||
;busy-level=2				; Signal busy at 2 or more calls
 | 
			
		||||
;outboundproxy=proxy.provider.domain	; send outbound signaling to this proxy, not directly to the peer
 | 
			
		||||
					; Call-limits will not be enforced on real-time peers,
 | 
			
		||||
					; since they are not stored in-memory
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user