[Solved] Asterisk ManagerEvent_ExtensionStatus

Hello Asterisk Community,

I have an issue with Asterisk 11 and Asterisk 13, with extension status from AMI.
I configured manager.conf with the data needed for external app to manage some data on asterisk server, and I am trying to connect an app from http://asterswitchboard.com , after installing it which is used as a CTI Panel for Asterisk, the connection with asterisk server is OK, but when the app is trying to show the status of the asterisk peers even they are reachable and OK on asterisk … the App-AMI connection shows this log = UNKNOWN

30-04-2018 15:44:28 DEBUG ExtensionStateAction Interno 8501 : ManagerResponse {DateReceived:15:44:28; ActionId:21433709_90; Message:Extension Status; Response:Success; Attributes:[exten:8501; context:inside; status:-1; statustext:Unknown]}

Meaning it is not showing the correct status of the peers because it is telling unknown while the peer is OK… why is that do we need any special configuration on sip.conf or it’s enough this one, does anybody has experience on this ?

[8501]
deny=0.0.0.0/0.0.0.0
secret=xyz123
dtmfmode=rfc2833
canreinvite=no
context=inside
host=dynamic
trustrpid=yes
sendrpid=pai
type=friend
session-timers=accept
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp,tcp,tls
avpf=no
force_avp=no
icesupport=no
encryption=no
namedcallgroup=
namedpickupgroup=
dial=SIP/8502
mailbox=8502@default
permit=0.0.0.0/0.0.0.0
callerid=Emerg- Operatori 2 <8501>
callcounter=yes
faxdetect=no
cc_monitor_policy=generic

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerEvent_ExtensionStatus

This app is working with FreePBX asterisk (it is showing correct status of peers) but not with versions like 11 and 13 whcih i tested

As you can see the staus is ok:

gjak_emerg192*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
8500/8500 10.30.150.29 D No No A 5060 OK (10 ms)
8501/8501 10.30.150.55 D No No A 5060 OK (5 ms)
8502/8502 10.30.150.49 D No No A 5060 OK (4 ms)

ExtensionStatus gets the state of an extension, not a device directly. What is the dialplan for the context you are trying (inside)? If there is no hint for the extension telling it that ‘8501’ is SIP/8501 then it wouldn’t know. You can also use “core show hints” on the CLI to see.

1 Like

Hello @jcolp, thnak you for the response, when i use core show hints :

gjak_emerg192*CLI> core show hints

-= Registered Asterisk Dial Plan Hints =-

1000@demo : SIP/1000 State:Unavailable Presence:not_set Watchers 0
1001@demo : SIP/1001 State:Unavailable Presence:not_set Watchers 0
1234@default : SIP/1234 State:Unavailable Presence:not_set Watchers 0

  • 3 hints registered
    gjak_emerg192CLI>
    gjak_emerg192
    CLI> sip show peers
    Name/username Host Dyn Forcerport Comedia ACL Port Status Description
    8500/8500 10.30.150.29 D No No A 5060 OK (10 ms)
    8501/8501 10.30.150.55 D No No A 5060 OK (7 ms)
    8502/8502 10.30.150.49 D No No A 5060 OK (4 ms)
    8503/8503 192.168.1.222 D No No A 5060 OK (9 ms)

Dialplan on extensions.conf is:

exten => 8500,1,Macro(stduser,SIP/8500,60)
same => n,Hangup()
exten => 8501,1,Macro(stduser,SIP/8501,60)
same => n,Hangup()
exten => 8502,1,Macro(stduser,SIP/8502,60)
same => n,Hangup()

what can be wrong configured in this case?

You have not configured a hint[1] so it does not know what device the extension “8501” is.

[1] https://wiki.asterisk.org/wiki/display/AST/Extension+State+and+Hints

Ok, so when i configure the hints on extensions.conf like this for example :
[inside]
exten = 8500,hint,SIP/Alice&SIP/Alice-mobile
exten = 8501,hint,SIP/Bob
exten = 8502,hint,SIP/Charlie&DAHDI/3
exten = 8503,hint,SIP/Diane,CustomPresence:Diane
is it going to show also the state like Available ? or need something else to configure?
*CLI> core show hints
-= Registered Asterisk Dial Plan Hints =-
example:
8500@internal : SIP/Charlie&DAHDI/3 State:Unavailable Watchers 0

The wiki provides an example. In your scenario it would be:

exten => 8501,hint,SIP/8501

If you want extension “8501” to be associated with “SIP/8501”.

1 Like

All set…thanks a lot @jcolp, problem solved now i see the status of the peers