<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span></span></div><div>Thanks for the suggestions. I made changes to res_agi to save the PID of the app into a channel variable (struct ast_chan). Upon UNHOLD event, I could kill() with that PID.<br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Tilghman Lesher &lt;tilghman@meg.abyt.es&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Asterisk Developers Mailing List &lt;asterisk-dev@lists.digium.com&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, August 31, 2012 10:58 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [asterisk-dev] Need
 to run an AGI from dialplan only upon call hold<br> </font> </div> <br>
On Fri, Aug 31, 2012 at 12:49 PM, Steve Edwards<br>&lt;<a ymailto="mailto:asterisk.org@sedwards.com" href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>&gt; wrote:<br>&gt; UN-TOP-POSTING...<br>&gt;<br>&gt;&gt; &gt; From: Steve Edwards &lt;<a ymailto="mailto:asterisk.org@sedwards.com" href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>&gt;<br>&gt;&gt;<br>&gt;&gt; &gt; man 2 kill ?<br>&gt;<br>&gt;<br>&gt; On Fri, 31 Aug 2012, uma udupi wrote:<br>&gt;<br>&gt;&gt; Yes it works for me, however I somehow need to get the pid of my AGI<br>&gt;&gt; instance (I can not use killall, as I may not want to kill all the instances<br>&gt;&gt; of my AGI), which is only available in res_agi (upon fork() of the AGI) or<br>&gt;&gt; the AGI instance itself.<br>&gt;<br>&gt;<br>&gt; Just thinking out loud...<br>&gt;<br>&gt; How about if your AGI stuffed it's PID in a channel variable?<br><br>Alternatively, since res_agi already knows this
 information, he could<br>create a dialplan function or simply an ast_agi_ api call to retrieve<br>that value.&nbsp; It's currently only passed into the agi processing loop,<br>but it could be very easily stored in a channel datastore.<br><br>-Tilghman<br><br>--<br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp;  http://lists.digium.com/mailman/listinfo/asterisk-dev<br><br><br> </div> </div>  </div></body></html>