Custom context module Return to destination

VitalPBX Community Support General Discussion Custom context module Return to destination

  • Post
    PitzKey
    Participant
    US
    Up
    0
    Down

    Hello,

    We tried setting up a custom context, it goes to the custom dialplan just fine, but when using the Return() application, it does not go to the destination specified in the GUI. 

    Our custom dialplan:

    [front-door]
    exten => s,1,Noop()
    same => n,System(do something here)
    same => n,Return()

    So to troubleshoot I looked at the dialplan, and I see the below what the PBX generated:

    [custom-contexts]
    exten => cc-3,1,NoOp(Main_Door)
    same => n,Gosub(front-door,s,1(app-time-condition,TC-11,1))
    same => n,Hangup()

    So now I see why it does not work, because it passes the destination as a argument

    I know we can use something like:

    [front-door]
    exten => s,1,Noop()
    same => n,System(do something here)
    same => n,Goto(${ARG1},${ARG2},${ARG3})

    But that is not clean and missing the point of using Gosub() and Return()

    Am I missing something here?

    Thank you

    0
Viewing 4 replies - 1 through 4 (of 4 total)
  • Replies
    mo10
    Moderator
    none
    Up
    0
    Down
    The destination is send as variable to your custom context.
     

    The parameters are in the format: context,extension,priority
    ${ARG1}, ${ARG2}, ${ARG3}
     
    You can do whatever you want with it.
    Like jump to another custom context and so on.
     
    What would you need instead?
     
    0
    PitzKey
    Participant
    US
    Up
    0
    Down
    As explained above, if it’s being used as a GoSub, then the easiest way would be to allow using a Return()
    0
    kasto
    Participant
    Up
    0
    Down
    I ran into the same problem. I don’t want to go to another custom script but simply continue with the original context like so:

    [cos-all](+)
    exten => s,1,NoOp(Marker)
    same => n, (do something here)
    same => n,Return()

    But instead of continuing the original script Asterisk hangs up after this message:

    Auto fallthrough, channel 'Local/50@ring-group-dial-00000007;2' status is 'UNKNOWN'

    Is this a bug or am I missing something here?

     

     

    0
    Up
    0
    Down
    kasto,

    Please open a new post with all the required information, like screenshots, VitalPBX version, and any other relevant information.

    0
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom context module Return to destination’ is closed to new replies.