Need Help on Asterisk Dialplan with multiple Hangup Macros in One Context

Hello Team,

Hope you are doing well.

I’m facing one small problem in running Dialplan.
We have one inbound route in sip.conf and wanna run multiple context for different clients.

Let me explain our requirement here

In SIP.conf we have only one inbound route where incoming call is coming though the context = incoming and we have created the same context in extension.conf below is the sample example which we are using

[incoming]
        exten => 5146300,1,macro(To-Incoming-Call-Flow)
        exten => 5146301,1,macro(To-Custom-Call-Flow)
        exten => 5146302,1,macro(To-Speech-To-Text-Flow)
        exten => h,1,GoTo(macro-To-ALL-Hangup-Call-Flow,h,1)

Now problem in exten => h,1,GoTo(macro-To-ALL-Hangup-Call-Flow,h,1) we need multiple Hangup (exten => h ) extension for above macro.

Currently any of above macro run always run Hangup extension in any case but we need separate hangup for each macro , Is it Possible in this case ?

Please share your feedback and idea for this task

I need urgent solution for this.

Regards
Manoj

I think you should use GoTo and if that’s not the case then you should be using GoSub and not Macro if you are on the latest version of Asterisk.

Remove h extension from [incoming] and place it in each GoTo/GoSub/Macro context

You can use Hangup Handlers and set an additional hangup to your call once you don’t wanna add one for each macro.
Call that before Goto.
https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers

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