<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You can pass variables in the Originate Action, see
<a class="moz-txt-link-freetext" href="http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate">http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate</a>.<br>
<br>
Taken from there:<br>
<br>
<strong>Variable</strong>: Channels variables to set (max 32).
Variables will be set for both channels (local and connected).
<br>
<h3><small>Example(Placing a call from a SIP channel to an extension,
this
will cause the outside call not to be placed until the SIP channel has
picked up):</small>
</h3>
<br>
Action: Originate
<br>
Channel: SIP/101test
<br>
Context: default
<br>
Exten: 8135551212
<br>
Priority: 1
<br>
Callerid: 3125551212
<br>
Timeout: 30000
<br>
<b>Variable: var1=23|var2=24|var3=25</b><br>
ActionID: ABC45678901234567890
<br>
<br>
That variables to send in the Originate action will become channel
variables that can be retrieved on the context where the call goes. You
can check that the variables exist on the context when the call is
answered, for example:<br>
<br>
[default]<br>
exten =&gt; 8135551212,1,Noop(var1 is ${var1})<br>
exten =&gt; 8135551212,n,Noop(var2 is ${var2})<br>
exten =&gt; 8135551212,n,Noop(var3 is ${var3})<br>
...<br>
<br>
and so on... with no need to call Macro() or Gosub().<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">-- 
Ing. Miguel Molina
Grupo de Tecnolog&iacute;a
Millenium Phone Center

</pre>
Anahi Ludue&ntilde;a escribi&oacute;:
<blockquote cite="mid:COL124-W649DF23C202C3F38CC86CE93E20@phx.gbl"
 type="cite">
  <style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
  </style>Thanks,<br>
I asked you to execute the GoSub from the Originate action, because I
need to pass some parameters.<br>
First, I created a macro since I could pass the parameters from
originate. But the macro's problem is it doesn't jump to the particular
extension (for example: h extension). So, when you told me that GoSub
could "replace" the Macro, I thought it could be called from the
Originate...<br>
Do you know if there is another way to pass some parameters to a
context from the Originate?<br>
Thank you!<br>
  <br>
  <br>
  <div>
  <p align="center"><font face="Verdana, Geneva, Arial, Sans-serif"><strong>
  <hr></strong></font></p>
  <p align="center"><font face="Verdana, Geneva, Arial, Sans-serif"><strong>Anahi
Ludue&ntilde;a</strong></font></p>
  <p align="center">&nbsp;</p>
  </div>
  <br>
  <hr id="stopSpelling">Date: Wed, 16 Sep 2009 10:27:26 -0500<br>
From: <a class="moz-txt-link-abbreviated" href="mailto:mmolina@millenium.com.co">mmolina@millenium.com.co</a><br>
To: <a class="moz-txt-link-abbreviated" href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a><br>
Subject: Re: [asterisk-users] MeetMe in Macro<br>
  <br>
Hi,<br>
  <br>
The GoSub() application is intended for use in the dialplan, not to
call it from a Originate Action. What is your specific need? You can
Originate to a extension instead of an application an then if you need
to execute a subroutine, you can use GoSub() and Return() then you need
to on the called context.<br>
  <br>
You can check
  <a moz-do-not-send="true" class="EC_moz-txt-link-freetext"
 href="http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+Gosub">http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+Gosub</a>
but the
example using the same context is not very clear.<br>
  <br>
A better example would be this:<br>
  <br>
[incoming]<br>
exten =&gt; s,1,Answer()<br>
exten =&gt; s,n,Noop(one)<br>
exten =&gt; s,n,Noop(two)<br>
exten =&gt; s,n,GoSub(mysub,s,1)<br>
exten =&gt; s,n,Noop(I returned!)<br>
exten =&gt; s,n,Hangup<br>
  <br>
[mysub]<br>
exten =&gt; s,1,Noop(So I'm at a subroutine)<br>
exten =&gt; s,n,Noop(I need to do special steps)<br>
exten =&gt; s,n,Playback(tt-monkeys)<br>
exten =&gt; s,n,Return()<br>
  <br>
Cheers,<br>
  <pre class="EC_moz-signature">-- 
Ing. Miguel Molina
Grupo de Tecnolog&iacute;a
Millenium Phone Center
  </pre>
  <br>
Anahi Ludue&ntilde;a escribi&oacute;:
  <blockquote cite="mid:COL124-W7BF1D7F18C49EE10E500693E20@phx.gbl">
    <style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
    </style>Thanks Miguel, It was my mistake.<br>
So, my question is:<br>
&nbsp;&nbsp;&nbsp; if I want to call the GoSub application from
the Originate Action (using AMI), what I need to put in the context
parameter? The GoSub will jump to a special context.<br>
Thanks,<br>
    <br>
    <br>
    <br>
    <hr id="EC_stopSpelling">Date: Wed, 16 Sep 2009 09:34:31 -0500<br>
From: <a moz-do-not-send="true" class="EC_moz-txt-link-abbreviated"
 href="mailto:mmolina@millenium.com.co">mmolina@millenium.com.co</a><br>
To: <a moz-do-not-send="true" class="EC_moz-txt-link-abbreviated"
 href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>;
    <a moz-do-not-send="true" class="EC_moz-txt-link-abbreviated"
 href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a><br>
Subject: Re: [asterisk-dev] MeetMe in Macro<br>
    <br>
    <title></title>
Hi,<br>
    <br>
I didn't notice on my first answer, but we are on the -dev list and
this is not related to asterisk code developing. I will answer you on
the -users list, so we can continue the discussion there.<br>
    <br>
Cheers,<br>
    <pre class="EC_EC_moz-signature">-- 
Ing. Miguel Molina
Grupo de Tecnolog&iacute;a
Millenium Phone Center
  </pre>
  </blockquote>
</blockquote>
</body>
</html>