Continue dialplan after dial()

Asterisk 13.18.1
Centos 7

I want to continue dialplan after dial application is this possible?

I tried the following
Dial(PJSIP/1234@myendpoint,30,g)
‘g’: Proceed with dialplan execution at the next priority in the
current extension if the destination channel hangs up.

I want if the caller or callee hangup continue? Is this possible?

I did google and searched asterisk community and I didnt find my answer directly but after reading more of the documentation there is an alternative way to continue the dialplan.
you can set the following before dial
Set(CHANNEL(hangup_handler_push)=hangUp,hUP,1)
Dial(PJSIP/1234@myendpoint,30,gb(context^ext^priority)) ;// go to sub before dial

[hangUp]
exten => hUP, 1, NoOp(Hang Up and Get Data for Export!)
same => n, Return()

Hoped I helped some1

These are the dial command options to continue any dialplan execution after any of the parties hangup

  • F ( context^exten^priority ) - When the caller hangs up, transfer the called party to the specified destination and start execution at that location.
    NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars (’_’).
    • context
    • exten
    • priority
  • F - When the caller hangs up, transfer the called party to the next priority of the current extension and start execution at that location.
    NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars (’_’).
    NOTE: Using this option from a Macro() or GoSub() might not make sense as there would be no return points.
  • g - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.
1 Like

Hello gents, Asterisk noob here. I’m trying something similar except i would like to execute commands while the call is actually happening - not after the call has hung up. Any ideas about how i could accomplish that?

Very different. Please start your own thread and be more specific.