Different behaviour in dialplan between AEL and LUA

I’m rewriting dialplan from AEL to LUA. By accident, we found a weird behaviour. Using AEL dialplan stops processing command immediately after user hangup which is expected.
While using LUA, after hangup logs show that the next commands are executed. Which in case of app queue triggers AMI event (join queue)

The question is if it’s normal behaviour? Could I change it?

I’m including logs from each case. I’m disconnecting during intro message.
Steps in AEL and LUA are the same. I’m including logs and extensions.[ael|lua]

I’m using Asterisk 14.7.5

#############################
Using AEL

context queues {
3000 => {
Set(CHANNEL(musicclass)=xxxxmusic);
Answer();
Wait(0.5);
Playback(audio_prompts/xxxx/intro);
Playback(audio_prompts/xxxx/committed);
Queue(customerservices,Rt,);
Hangup();
};
}

— Log
– Executing [3000@pstn-inbound:9] Playback(“SIP/voicegateway01-00000000”, “audio_prompts/xxxx/intro”) in new stack
– <SIP/voicegateway01-00000000> Playing ‘audio_prompts/xxxx/intro.ulaw’ (language ‘en’)
> 0x7f0f24069890 – Strict RTP learning complete - Locking on source address x.x.x.x:17880

#############################
Using LUA

extensions = {

queues = {
    ["3000"] = function()
        queue_store(“xxxx”)
    end;

}

function queue_store(store)
log_call(store)
channel.CHANNEL(“musicclass”):set(stores[store][“music_on_hold”])
local caller = channel.CALLERID(“num”):get()
app.Answer()
app.Wait(1)
app.Playback(“audio_prompts/” … store … “/intro”)
app.Playback(“audio_prompts/” … store … “/committed”)
app.Queue(customer_services_queue, Rt)
app.Hangup()
end

— Log
== Using SIP RTP CoS mark 5
> 0x7ff3800725e0 – Strict RTP learning after remote address set to: x.x.x.x:18810
– Executing [3000@pstn-inbound:1] Answer(“SIP/voicegateway01-00000002”, “”)
> 0x7ff3800725e0 – Strict RTP switching to RTP target address x.x.x.x:18810 as source
– Executing [3000@pstn-inbound:1] Wait(“SIP/voicegateway01-00000002”, “1”)
– Executing [3000@pstn-inbound:1] Playback(“SIP/voicegateway01-00000002”, “audio_prompts/xxxx/intro”)
– <SIP/voicegateway01-00000002> Playing ‘audio_prompts/xxxx/intro.ulaw’ (language ‘en’)
> 0x7ff3800725e0 – Strict RTP learning complete - Locking on source address x.x.x.x:18810
– Executing [3000@pstn-inbound:1] Playback(“SIP/voicegateway01-00000002”, “audio_prompts/xxxx/committed”)
– <SIP/voicegateway01-00000002> Playing ‘audio_prompts/xxxx/committed.ulaw’ (language ‘en’)
– Executing [3000@pstn-inbound:1] Queue(“SIP/voicegateway01-00000002”, “customerservices,”)
– Started music on hold, class ‘xxxxmusic’, on channel ‘SIP/voicegateway01-00000002’
== Spawn extension (pstn-inbound, 3000, 1) exited non-zero on ‘SIP/voicegateway01-00000002’
– Stopped music on hold on SIP/voicegateway01-00000002

Both AEL and LUA are unsupported and not used by many individuals, you may not find any answer on here due to that.

Thank you for your response. But honestly, I’m a bit surprised by your answer. Especially when there are dedicated topics covering these topics:

So what is supported? Only plain extensions.conf? Is there an alternative? or should we use AGI/AMI/ARI ?

There may be sections on the wiki, but the modules themselves do not have a designated maintainer and thus are reliant on the community to support them. They also do not receive features or anything else since noone works on them.

The module which handles extensions.conf is core supported (meaning we - Digium/Sangoma - will accept bugs for it and such). It is also what the vast majority of users use.

1 Like

OK. Thank you for the clarification. Good to know that :slight_smile:

To finish this conversation. So what approach should one take to configure more complex dialplan?

Everything has pros and cons, but people have been able to do quite a lot in extensions.conf