Hello Asterisk Community,
I am seeking assistance with an issue I’m experiencing in Asterisk 11.25.3, regarding playing back a message when a call ends due to an unassigned number (i.e., when the call is a “dead number” or “empty number”).
Core Technical Challenge:
I need to play a specific message (when-number-empty.wav
) when a call ends because the dialed number is unallocated. The primary indicator I’m relying on is X-Asterisk-HangupCauseCode: 1
.
Attempts and Observations:
- Initial Approach:
-
My initial idea was to add the following code (the part after h) to outCallConfig.ael in order to make changes only to the umigame-softbank loop
-
I added logic in the
h
extension of my dialplan to play the message based on${HANGUPCAUSE}
. -
Code Snippet:
s => {
LINE = "0000";
Agi(agi://127.0.0.1:7891/AgiDialoutable?account=${ACCOUNT}&connecttype=${CONNECT_TYPE}&dprefix=${LINE}&calledno=${FROM_DID});
Dial(SIP/${CalledNo}@umigame-softbank,,e);
}
h => {
NoOp("Hangup cause: ${HANGUPCAUSE}");
if (${HANGUPCAUSE} == 1) {
Playback(when-number-empty);
}
}
- Outcome: The playback did not occur as expected.
Questions:
- Is there a better way to detect an empty number and trigger playback in Asterisk 11.25.3?
- Are there known limitations or common pitfalls in using
h
extension for such playback scenarios? - Any suggestions or alternative approaches that I might consider to achieve this functionality?
I appreciate any guidance or insights you can provide. Thank you in advance for your help!