Help Needed with Playback on Call Hangup in Asterisk 11.25.3

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:

  1. 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:

  1. Is there a better way to detect an empty number and trigger playback in Asterisk 11.25.3?
  2. Are there known limitations or common pitfalls in using h extension for such playback scenarios?
  3. 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!

Few people will remember what Asterisk 11 does, and few people here use .ael, etc.

The h extension is run after the technology driver has been shut down on the call and there is no media path. There seems no reason to not do this on the original extension, after the Dial.

1 Like

Thanks for your responding! Finally I changed it to this. And it worked.

context 388-call {
    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,,g);
        NoOp("Hangup cause: ${HANGUPCAUSE}");
        if (${HANGUPCAUSE} == 1) {
            Playback(when-number-empty);
    }
}

Based on your response, I feel sorry for my company’s outdated CTI production. I work for a Japanese manufacturer of CTI. We often have problems due to call quality issues. We hope that in future updates we can use a better Asterisk version to improve call quality.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.