How to call a number in a extern context and return to my

Good morning, colleagues!

Tell me, please, how methodically correctly solve the following problem …

  1. I have a local context,for exampe [local], where are my users.
  2. I have a context with uplinks, where are all my correctly listed uplinks - my city, Moscow, District, Russia, World - [uplinks] …

Sometimes I need to call from the context [local] number, described in the [uplinks], and then return to the [local].
Simple SIP terminals are not able to do a transfer if his owner not answer, and I has to describe this in dialplan [local].

For example:

[local] ... ; Ivan Ivanov, then redir to his mobile, then voicemail exten => 123,1,Dial(SIP/Ivan,16) same => n,Goto(uplinks,79162345678,1) same => n,Macro(voicemail,office,${EXTEN},ru) same => n,HangUp() ...

It is obvious that after the transition GoTo() control will not return to the context [local] and the voicemail not be served this user.

How do I correctly place a call to a mobile number in a different context, which would then, if that fails, continue to go on this context?

Ogogon.

Gosub, but the other context needs to be written to support that, or use a “local” channel.

Thank you.

But why in the subroutine does not work operator “include =>”?
In my opinion, it is very awkward …

Ogogon.

A local channel is an easier approach.

I suspect you are misusing “include =>”; I can think of no reason why it should not work when a context is invoked as a subroutine.