B.47. Gosub()

Jumps to the specified priority, extension and context and allows return.
Gosub([[context,]extension,]priorität)
Gosub(named_priority)
Like Goto() but allows the dialplan subroutine to return with Return().
Returns 0, or -1 if the target is invalid.
exten => 123,1,Gosub(set-cid)
exten => 123,n,Dial(SIP/${EXTEN})

exten => 123,10(set-cid),Set(CALLERID(all)=Widgets Inc <(212-555-3412>)
exten => 123,n,Return()

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'Gosub' =- 

[Synopsis]
Jump to label, saving return address

[Description]
Gosub([[context|]exten|]priority)
  Jumps to the label specified, saving the return address.
diff output to internal help in Asterisk 1.2:
- none -