<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"
xml:lang="en">
<title></title>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--html
        {overflow-x: visible;}
body
        {overflow-x: visible;}
html
        {overflow-y: auto;
        overflow-x: auto;}
body
        {overflow:show;}
.MISSPELLED
        {background-attachment:scroll;
        background-position-x:50%;
        background-position-y:100%;}
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.misspelled, li.misspelled, div.misspelled
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=purple id=bodyElement>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>These may just be WAG’s, but they
are worth a try. Put exten => s,n,goto(wherever|s|1) at the end of the
macro to make it go to the next live place. As for starting the AGI when
the caller answers, you can’t really do that; you either have to
start the AGI before answer or run it as a DeadAGI on hangup.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>selmak se<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, July 03, 2009 10:31
AM<br>
<b><span style='font-weight:bold'>To:</span></b>
asterisk-users@lists.digium.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> [asterisk-users] Trigger
an action when B number answers the call</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>Hello,<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>I was trying to trigger an action (using AGI) when the recipient of a
call (B number) answers his phone. (Actually the goal is to send a signal to an
external server when the call starts )<o:p></o:p></span></font></p>
<p id="__paragraph__1246634952000"><font size=1 face=Verdana><span lang=EN
style='font-size:9.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p id="__paragraph__1246634957000"><font size=1 face=Verdana><span lang=EN
style='font-size:9.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>I tried using M (macro call) in 'Dial' as follows :<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>exten =>
1008,n,Dial(SIP/1008||L(40000:10000:5000)M(macroSendCallStart^${UNIQUEID})) <o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>Then the macro calls the AGI :<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p style='margin-bottom:12.0pt'><font size=1 face=Verdana><span lang=EN
style='font-size:9.0pt;font-family:Verdana'>[macro-macroSendCallStart]<br>
<br>
exten => s,1,Verbose(macro-macroSendCallStart)<br>
exten => s,n,Verbose(UNIQUEID ${UNIQUEID} )<br>
exten => s,n,Verbose(ARG1 ${ARG1} )<br>
exten => s,n,AGI(myAGI.agi,2,${ARG1},${CALLERID(num)},001) <o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>The problem is that the macro is 'forked' (new UNIQUEID) and when it
ends goes to _h_ extesion triggering unwanted actions..<o:p></o:p></span></font></p>
<p id="__paragraph__1246635018000"><font size=1 face=Verdana><span lang=EN
style='font-size:9.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>Any idea about how to avoid going to _h_ extension when a macro ends?<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>Any other idea about how to trigger an AGI call when B number answers?<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>Regards,<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'>Sel<o:p></o:p></span></font></p>
<p><font size=1 face=Verdana><span lang=EN style='font-size:9.0pt;font-family:
Verdana'><o:p> </o:p></span></font></p>
<p style='margin-bottom:12.0pt' size=2><font size=1 face=Verdana><span lang=EN
style='font-size:9.0pt;font-family:Verdana'><o:p> </o:p></span></font></p>
</div>
</body>
</html>