How to make Asterisk keep track of dynamic SIP agent statuses

asterisksip

I am setting up a new server using Asterisk 1.8.11-certified4. In testing, we're seeing that agents dynamically logged into the queue will receive a second queue call as a call-waiting when call-limit is set to 0.

Since the agents in question are not always in the agent queue, call-limit=1 would unnecessarily prevent them from receiving call waiting even when they're out of the queue.

The test and result from the below configs were as follows:

  • Had remote user login to queue
  • Placed call into queue
  • remote user answered call #1
  • placed call #2 to queue
  • remote user reported the second call came in as a call-waiting.

extensions.ael

context enter-sales-queue {
        s => {
                Answer();
                Queue(den-x-queue,,,,60);
                Voicemail(9001,u);
                Hangup();
        };
};

queues.conf


[den-careers-queue]
strategy=leastrecent
timeout=17
ringinuse=no
autopause=no
musicclass = default
context = so-operator
monitor-format = wav
setinterfacevar = yes
timeoutpriority = conf
monitor-type=MixMonitor
reportholdtime=no
ringinuse=no
joinempty=strict
leavewhenempty=strict
retry=2

sip.conf


[local-codecs](!) ; local user codecs, dont compress.
disallow=all
allow=ulaw
allow=alaw

[basic-options](!) ; template for what every sip user should have
dtmfmode=rfc2833
context=stationside
type=friend
host=dynamic
allowsubscribe=yes
subscribecontext=blf
notifyringing=yes
notifyhold=yes
limitonpeers=yes
call-limit=0

[local-mode](!,basic-options,local-codecs)
nat=no
qualify=yes

[6599](local-mode)
secret=xxxx
callerid=Peter Grace 
accountcode=foobar

Best Answer

I asked the same question in the Asterisk IRC channel on freenode, and one of the developers responded indicating that in newer asterisk versions (I assume 1.8 and above) you need to specify callcounter=yes in your general config of sip.conf.

He also mentioned that call-limit should never be zero, as that is not technically a valid option for that field. It should be 1 or greater.

In versions of asterisk prior to 1.8, callcounter=yes does not exist, so simply specifying a call-limit with an arbitrarily high number will cause Asterisk to track the number of calls properly and make the queue function as expected.


IF ASTERISK 1.8 OR LATER:

sip.conf


[general]
callcounter=yes

IF ASTERISK PRIOR TO 1.8:

sip.conf


[exten]
type=friend
...
call-limit=999