No subject


Fri Sep 2 03:59:05 CDT 2011


rly there would be a heavy penalty to launching a shell so you would want t=
o carefully evaluate the frequency this is executed on your system.<br />
<div class=3D"container">
<div class=3D"line number1 index0 alt2"><code class=3D"sql plain"><br />
DELIMITER @@</code></div>
<div class=3D"line number2 index1 alt1">&nbsp;</div>
<div class=3D"line number3 index2 alt2"><code class=3D"sql keyword">CREATE<=
/code> <code class=3D"sql keyword">TRIGGER</code> <code class=3D"sql
plain">Test_Trigger </code></div>
<div class=3D"line number4 index3 alt1"><code class=3D"sql keyword">AFTER</=
code> <code class=3D"sql keyword">INSERT</code> <code class=3D"sql
keyword">ON</code> <code class=3D"sql plain">MyTable </code></div>
<div class=3D"line number5 index4 alt2"><code class=3D"sql keyword">FOR</co=
de> <code class=3D"sql plain">EACH ROW </code></div>
<div class=3D"line number6 index5 alt1"><code class=3D"sql keyword">BEGIN</=
code></div>
<div class=3D"line number7 index6 alt2"><code class=3D"sql spaces">&nbsp;</=
code><code class=3D"sql keyword">DECLARE</code> <code class=3D"sql plain">c=
md </code><code class=3D"sql keyword">CHAR</code><code class=3D"sql
plain">(255);</code></div>
<div class=3D"line number8 index7 alt1"><code class=3D"sql spaces">&nbsp;</=
code><code class=3D"sql keyword">DECLARE</code> <code class=3D"sql plain">r=
esult </code><code class=3D"sql keyword">int</code><code class=3D"sql
plain">(10);</code></div>
<div class=3D"line number9 index8 alt2"><code class=3D"sql spaces">&nbsp;</=
code><code class=3D"sql keyword">SET</code> <code class=3D"sql plain">cmd=
=3DCONCAT(</code><code class=3D"sql string">'sudo /home/sarbac/hello_world =
'</code><code class=3D"sql plain">,</code><code class=3D"sql string">'Sarba=
jit'</code><code class=3D"sql plain">);</code></div>
<div class=3D"line number10 index9 alt1"><code class=3D"sql spaces">&nbsp;<=
/code><code class=3D"sql keyword">SET</code> <code class=3D"sql plain">resu=
lt =3D sys_exec(cmd);</code></div>
<div class=3D"line number11 index10 alt2"><code class=3D"sql keyword">END</=
code><code class=3D"sql plain">;</code></div>
<div class=3D"line number12 index11 alt1"><code class=3D"sql plain">@@</cod=
e></div>
<div class=3D"line number13 index12 alt2"><code class=3D"sql plain">DELIMIT=
ER ;<br />
<br />
</code></div>
</div>
-dbc<br />
<br />
<blockquote cite=3D"mid:mailman.7.1348074001.2526.asterisk-users at lists.digi=
um.com" type=3D"cite">
<pre>Message: 1
Date: Tue, 18 Sep 2012 15:41:46 -0400
From: Ahmed Munir <a href=3D"mailto:ahmedmunir007 at gmail.com" class=3D"moz-t=
xt-link-rfc2396E">&lt;ahmedmunir007 at gmail.com&gt;</a>
Subject: [asterisk-users] Trigger Asterisk after data inserted in
	mysql
To: <a href=3D"mailto:asterisk-users at lists.digium.com" class=3D"moz-txt-lin=
k-abbreviated">asterisk-users at lists.digium.com</a>
Message-ID:
	<a href=3D"mailto:CAGMN=3DJdbE5FdDSQXxZ9OrWXu3Pvgc-hj-EnPxUrG=3DRJHGSD-eg@=
mail.gmail.com" class=3D"moz-txt-link-rfc2396E">&lt;CAGMN=3DJdbE5FdDSQXxZ9O=
rWXu3Pvgc-hj-EnPxUrG=3DRJHGSD-eg at mail.gmail.com&gt;</a>
Content-Type: text/plain; charset=3D"iso-8859-1"

Hi all,


I would like to know, is there a way to trigger Asterisk after data
inserted into mysql DB? Like here what I'm trying to do, when the new data
inserted into MySQL DB, it sends the request to Asterisk along with the new
data (that is inserted in DB) for making outbound call i.e. Realtime.

Currently I've set a cron job that execute my script every 30 seconds and
checks for a new data in DB. If new data is inserted in 30 seconds that
script will run and sends the data to Asterisk for making calls. (This is
the case which I'm thinking to avoid)

Please advise.

</pre>
</blockquote><br />
<br /></span>

------=_NextPart_000_0001_296978FA.5782D02--




More information about the asterisk-users mailing list