[asterisk-users] DEVICE_STATE() and Asterisk 1.6.0.10
Barry L. Kline
blkline at attglobal.net
Wed Jul 15 17:45:46 CDT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mark Michelson wrote:
>
> You need to set a call-limit for the SIP peer. Device state calculation for a
> SIP peer is predicated on both the call-limit and busylevel. Let's say that you
> were to have a call-limit of 2, but no busylevel set. These are the device
> states reported for the peer based on the number of calls currently handled:
Hi Mark. Thanks for your explanation of these parameters.
I should have posted my configurations. I double-checked the contents
of sip.conf and I have this. The 'subscribecontext' was added for
testing, per the other reply I got for my question.
;
; Settings common to all devices on our system
;
[basic-options](!)
type=friend
host=dynamic
canreinvite=no
disallow=all
allow=ulaw
dtmfmode=rfc2833
qualify=yes
;
; Standard desksets here
;
[lan-deskset](!,basic-options)
context=sip-deskset
notifyringing = yes
notifyhold = yes
limitonpeers = yes
call-limit=99
[6668](lan-deskset)
secret=mysecret
callerid="Matts SIP" <6668>
username=Barry's IP450
call-limit=32
busylevel=1
subscribecontext=hint-context
My hint-context is:
[hint-context]
exten => 6668,hint,SIP/6668;
I'm still not getting anything other than NOT_INUSE from DEVICE_STATE.
Here is the CLI output:
[Jul 15 18:40:15] -- Executing [6668 at sip-deskset:1]
NoOp("SIP/6666-0955ecc8", "SIP/6668 has state NOT_INUSE") in new stack
[Jul 15 18:40:15] -- Executing [6668 at sip-deskset:2]
NoOp("SIP/6666-0955ecc8", "SIP/6666 has state NOT_INUSE") in new stack
[Jul 15 18:40:15] -- Executing [6668 at sip-deskset:3]
ExecIf("SIP/6666-0955ecc8", "0?Busy(10)") in new stack
[Jul 15 18:40:15] -- Executing [6668 at sip-deskset:4]
Dial("SIP/6666-0955ecc8", "SIP/6668") in new stack
And here is sip show inuse:
corp-asterisk*CLI> sip show inuse
* User name In use Limit
6668 1 32
6667 0 99
6666 1 99
* Peer name In use Limit
6668 1/1/0 32
6667 0/0/0 99
6666 0/0/0 99
For completeness, here is the dialplan that's producing this:
exten => 6668,1,NoOp(SIP/${EXTEN} has state ${DEVICE_STATE(SIP/${EXTEN})});
exten => 6668,n,NoOp(SIP/6666 has state ${DEVICE_STATE(SIP/6666)});
exten => 6668,n,ExecIf($[${DEVICE_STATE(SIP/${EXTEN})}="BUSY"]?Busy(10));
exten => 6668,n,Dial(SIP/${EXTEN});
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFKXlwaCFu3bIiwtTARAkRpAJ4+2WF9qrIwrC3Kdpwd0YAOm/5S1wCfUR1T
CtI9kZNQYpW2Sv6uFNud7Jo=
=9Zp/
-----END PGP SIGNATURE-----
More information about the asterisk-users
mailing list