Custom Context GoSub functionalities

Hello,

Since the custom contexts module adds the dialplan as a GoSub, please allow us to use the Return().

For example, right now, a custom context looks like this:

exten => cc-1,1,NoOp(Test Custom Context)
 same => n,Gosub(cc-foo-test,s,1(sub-extensions-vm,VM-104,1))
 same => n,Hangup()

Which forces us to have something like:

[cc-foo-test]
exten => ,s,1,Noop(Testing the foo context)
 same => n,.......
 same => n,Goto(${ARG1},${ARG2},${ARG3})

Please change it to:

exten => cc-1,1,NoOp(Test Custom Context)
 same => n,Gosub(cc-foo-test,s,1(sub-extensions-vm,VM-104,1))
 same => n,Goto(sub-extensions-vm,VM-104,1)
 same => n,Hangup()

So we can do:

[cc-foo-test]
exten => ,s,1,Noop(Testing the foo context)
 same => n,.......
 same => n,Return()

The next thing is Arguments. It would be very helpful if we you can add a section in the custom context module to allow passing arguments.

Keep in mind, that right now, the first 3 arguments are in use for the custom context’s destination. But if we implement the Return() function as described above, then you can free these up. Otherwise, we will only be able to use from ARG4 and up.

Thank you

2 Likes

Sounds great. When changing that: please keep in mind to make it an option (checkbox) since many rely on the old Gosub.