<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
It looks like the answer is yes.<br>
<br>
<a class="moz-txt-link-freetext" href="http://crazytechthoughts.blogspot.ca/2011/12/call-external-program-from-mysql.html">http://crazytechthoughts.blogspot.ca/2011/12/call-external-program-from-mysql.html</a><br>
<br>
From the page, here is code to execute a UDF library and call a
shell. Clearly there would be a heavy penalty to launching a shell
so you would want to carefully evaluate the frequency this is
executed on your system.<br>
<div class="container">
<div class="line number1 index0 alt2"><code class="sql plain"><br>
DELIMITER @@</code></div>
<div class="line number2 index1 alt1"> </div>
<div class="line number3 index2 alt2"><code class="sql keyword">CREATE</code>
<code class="sql keyword">TRIGGER</code> <code class="sql
plain">Test_Trigger </code></div>
<div class="line number4 index3 alt1"><code class="sql keyword">AFTER</code>
<code class="sql keyword">INSERT</code> <code class="sql
keyword">ON</code> <code class="sql plain">MyTable </code></div>
<div class="line number5 index4 alt2"><code class="sql keyword">FOR</code>
<code class="sql plain">EACH ROW </code></div>
<div class="line number6 index5 alt1"><code class="sql keyword">BEGIN</code></div>
<div class="line number7 index6 alt2"><code class="sql spaces"> </code><code
class="sql keyword">DECLARE</code> <code class="sql plain">cmd
</code><code class="sql keyword">CHAR</code><code class="sql
plain">(255);</code></div>
<div class="line number8 index7 alt1"><code class="sql spaces"> </code><code
class="sql keyword">DECLARE</code> <code class="sql plain">result
</code><code class="sql keyword">int</code><code class="sql
plain">(10);</code></div>
<div class="line number9 index8 alt2"><code class="sql spaces"> </code><code
class="sql keyword">SET</code> <code class="sql plain">cmd=CONCAT(</code><code
class="sql string">'sudo /home/sarbac/hello_world '</code><code
class="sql plain">,</code><code class="sql string">'Sarbajit'</code><code
class="sql plain">);</code></div>
<div class="line number10 index9 alt1"><code class="sql spaces"> </code><code
class="sql keyword">SET</code> <code class="sql plain">result
= sys_exec(cmd);</code></div>
<div class="line number11 index10 alt2"><code class="sql keyword">END</code><code
class="sql plain">;</code></div>
<div class="line number12 index11 alt1"><code class="sql plain">@@</code></div>
<div class="line number13 index12 alt2"><code class="sql plain">DELIMITER
;<br>
<br>
</code></div>
</div>
-dbc<br>
<br>
<blockquote
cite="mid:mailman.7.1348074001.2526.asterisk-users@lists.digium.com"
type="cite">
<pre wrap="">
Message: 1
Date: Tue, 18 Sep 2012 15:41:46 -0400
From: Ahmed Munir <a class="moz-txt-link-rfc2396E" href="mailto:ahmedmunir007@gmail.com"><ahmedmunir007@gmail.com></a>
Subject: [asterisk-users] Trigger Asterisk after data inserted in
        mysql
To: <a class="moz-txt-link-abbreviated" href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>
Message-ID:
        <a class="moz-txt-link-rfc2396E" href="mailto:CAGMN=JdbE5FdDSQXxZ9OrWXu3Pvgc-hj-EnPxUrG=RJHGSD-eg@mail.gmail.com"><CAGMN=JdbE5FdDSQXxZ9OrWXu3Pvgc-hj-EnPxUrG=RJHGSD-eg@mail.gmail.com></a>
Content-Type: text/plain; charset="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>
</body>
</html>