Re: [asterisk-users] Return without Gosub: stack is empty

2017-11-02 Thread Richard Mudgett
On Thu, Nov 2, 2017 at 1:25 PM, Dmitriy Serov  wrote:

> [sub-out-do-dial]
> exten => s,1,NoOp(Dial)
>  same => n,NoOp(FirstChannel: ${CHANNEL})
>  same => n,Dial(,60,gF)
>  same => n,NoOp(SecondChannel: ${CHANNEL})
>  same => n,Return()
>
> [some]
> exten => s,1,GoSub(sub-out-do-dial,s,1)
>
> In case of the destination channel hangs up in log i see:
> ERROR[26570][C-00e7] app_stack.c: Return without Gosub: stack is empty
>

I think you mean if the calling channel hangs up you get the error message.


>
> Yes. SecondChannel != FirstChannel.
> Is it a wrong way to use Dial(g)+Gosub? Or any Dial in sub?
>

The first channel (calling party) knows about being in the subroutine.  It
was the
channel executing dialplan to get into the subroutine.  Use of the g option
with this
dialplan is OK as the calling channel knows where the subroutine was called
from.

The second channel (called party) knows nothing about being in a subroutine
so it
cannot return from one.  It has not executed any dialplan before.  The F
option simply
tells it to start executing dialplan at the priority after the dial
application.  This dialplan
needs to be able to distinguish between the two channels and act
accordingly.  Using
the F() option with a dialplan location is the simplest way to distinguish
between the
two channels.

Richard
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Return without Gosub: stack is empty

2017-11-02 Thread Dmitriy Serov

[sub-out-do-dial]
exten => s,1,NoOp(Dial)
 same => n,NoOp(FirstChannel: ${CHANNEL})
 same => n,Dial(,60,gF)
 same => n,NoOp(SecondChannel: ${CHANNEL})
 same => n,Return()

[some]
exten => s,1,GoSub(sub-out-do-dial,s,1)

In case of the destination channel hangs up in log i see:
ERROR[26570][C-00e7] app_stack.c: Return without Gosub: stack is empty

Yes. SecondChannel != FirstChannel.
Is it a wrong way to use Dial(g)+Gosub? Or any Dial in sub?

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users