Asterisk 11 built from source code.
I was testing out a macro to send calls to voicemail and get the correct message based upon whether the call was never answered or whether the call was busy.
Relevant snippet:
[macro-standard_extension]
Exten => s,1,Dial(SIP/phone-1,10)
Exten => s,n,GotoIf($[“${DIALSTATUS}” = “BUSY”]?busy:)
Exten => s,n,Voicemail(6001@default,u)
Exten => s,n,Hangup()
Exten => s,n(busy),Voicemail(6001@default,b)
Exten => s,n,Hangup()
[internal_users]
Exten => 6001,1,Macro(standard_extension)
This code worked fine for a call that was never answered (got the unavailable VM message from phone 6001).
However, the busy branch did not work. When phone 6001 (a SIP phone) is made busy (2 active calls into the phone) and I try to place a 3rd call into the same phone, the macro executes and send me to 6001 VM - only instead of getting the busy message, I still get the unavailable message
Doing some debugging, I added a NoOp statement to show me the value of DIALSTATUS. The value of DIALSTATUS when the phone is in a busy state is CHANUNAVAIL - not BUSY as I would expect it to be.
I confirmed this by changing my GoToIF statement to read
Exten => s,n,GotoIf($[“${DIALSTATUS}” = “CHANUNAVAIL”]?busy:)
Now, when I put 6001 into a busy state and try to place a 3rd call, I get sent to voicemail but I receive the correct Busy message.
So, anyone know why I am getting CHANUNAVAIL and not BUSY?
BTW, in sip.conf I have allowsubscribe=yes, callcounter=yes and on that SIP phone, both call-limit and busy are both set to 2.
I have been searching Google for about an hour and it seems that others have had this same issue, but no solutions.
Anyone?