Karthick Chandran
Karthick Chandran

Reputation: 3

DEVICE_STATE(SIP/mypeer) in Asterisk returning only UNAVAILABLE and NOT_INUSE, not returning other status why?

DEVICE_STATE(SIP/mypeer) is returning only UNAVAILABLE and NOT_INUSE but not the other available options such as UNKNOWN, INUSE, BUSY, INVALID, RINGING, RINGINUSE, ONHOLD.

exten=>1,NoOp(SIP/mypeer has state ${DEVICE_STATE(SIP/mypeer)})
same=>2,ExecIf($[${DEVICE_STATE(SIP/mypeer)}=NOT_INUSE]?Goto(5):Goto(2))

Here I am expecting the device_state should return busy, ringing, inuse or onhold at mypeer while getting a second call but I am getting only UNAVAILABLE and NOT_INUSE as output.

I already set callcounter=yes and call-limit=1000. What should I do now?

Upvotes: 0

Views: 1903

Answers (3)

Cyther
Cyther

Reputation: 11

as stated by the official page here: asterisk chan_sip state and presence

The callcounter option in sip.conf must be enabled for SIP devices (e.g. SIP/Alice) to provide advanced device state. Without it you may see some state, such as unavailable or idle, but not much more.

Upvotes: 1

anon
anon

Reputation: 11

callcounter=yes in [general] section sip.conf

Upvotes: 1

arheops
arheops

Reputation: 15247

You have add

qualify=yes

to your peer if you want get other states.

Upvotes: 0

Related Questions