Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call a context and return to the main context in asterisk?

Tags:

asterisk

Here is my dial plan in asterisk:

[main-context]
exten => s,1,Gosub(subcontext,s,1)
exten => s,n,NoOp(End Main)

[subcontext]
exten => s,1,NoOp(Start subcontext)
exten => s,1,NoOp(End subcontext)

The problem is that when subcontext finishes, execution doesn't return to main-context and exten => s,n,NoOp(End Main) doesn't execute. How can I solve this?

like image 583
Karadous Avatar asked Jun 19 '12 12:06

Karadous


1 Answers

As Karadous posted above: a GoSub routine must have a matching Return() application call.

[main-context]
exten => s,1,Gosub(subcontext,s,1)
same => n,NoOp(End Main)

[subcontext]
exten => s,1,NoOp(Start subcontext)
same => n,NoOp(End subcontext)
same => n,Return()
like image 79
Matt Jordan Avatar answered Oct 25 '22 22:10

Matt Jordan