Thanks Bryant and David for sharing.<br><br><br><br><br>  <br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: &quot;Bryant Zimmerman&quot; &lt;<a href="mailto:BryantZ@zktech.com">BryantZ@zktech.com</a>&gt;<br>
Subject: Re: [asterisk-users] Trigger Asterisk after data inserted in<br>
        mysql<br>
To: &quot;Asterisk Users Mailing List - Non-Commercial Discussion&quot;<br>
        &lt;<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>&gt;<br>
Message-ID: &lt;4d5734ed$7d50d85e$77bd1cd6$@<a href="http://zktech.com" target="_blank">zktech.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
David<br>
<br>
The way we do this is to have a trigger insert into a batch table. This<br>
table can be polled from a secondary process. That process/service is<br>
responsible for monitoring, working and cleanup. This allows for you to<br>
poll a highly optimized table without taking the db performance hit from<br>
larger tables that will grow over time. We process millions of cdr and<br>
process records a day this way. It also allows you balanced process loads<br>
across multiple servers. This can be extremely important on systems that<br>
are more heavily loaded. It also allows you to remove process load and<br>
latencies from the database servers.<br>
<br>
Thanks<br>
<br>
Bryant Zimmerman (ZK Tech Inc.)<br>
<a href="tel:616-855-1030%20Ext.%202003" value="+16168551030">616-855-1030 Ext. 2003</a><br>
<br>
----------------------------------------<br>
 From: &quot;David Cook&quot; &lt;<a href="mailto:dbc_asterisk@advan.ca">dbc_asterisk@advan.ca</a>&gt;<br>
Sent: Wednesday, September 19, 2012 2:04 PM<br>
To: <a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a><br>
Subject: Re: [asterisk-users] Trigger Asterisk after data inserted in<br>
mysql<br>
<br>
It looks like the answer is yes.<br>
<br>
<a href="http://crazytechthoughts.blogspot.ca/2011/12/call-external-program-from-mysq
l.html" target="_blank">http://crazytechthoughts.blogspot.ca/2011/12/call-external-program-from-mysq<br>
l.html</a><br>
<br>
&gt;From the page, here is code to execute a UDF library and call a shell.<br>
Clearly there would be a heavy penalty to launching a shell so you would<br>
want to carefully evaluate the frequency this is executed on your system.<br>
<br>
DELIMITER @@   CREATE TRIGGER Test_Trigger  AFTER INSERT ON MyTable  FOR<br>
EACH ROW  BEGIN  DECLARE cmd CHAR(255);  DECLARE result int(10);  SET<br>
cmd=CONCAT(&#39;sudo /home/sarbac/hello_world &#39;,&#39;Sarbajit&#39;);  SET result =<br>
sys_exec(cmd); END; @@ DELIMITER ;<br>
<br>
  -dbc<br>
<br>
 Message: 1 Date: Tue, 18 Sep 2012 15:41:46 -0400 From: Ahmed Munir<br>
&lt;<a href="mailto:ahmedmunir007@gmail.com">ahmedmunir007@gmail.com</a>&gt; Subject: [asterisk-users] Trigger Asterisk after<br>
data inserted in        mysql To: <a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a> Message-ID:<br>
        &lt;CAGMN=JdbE5FdDSQXxZ9OrWXu3Pvgc-hj-EnPxUrG=<a href="mailto:RJHGSD-eg@mail.gmail.com">RJHGSD-eg@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;  Hi all,   I would like to<br>
know, is there a way to trigger Asterisk after data inserted into mysql DB?<br>
Like here what I&#39;m trying to do, when the new data inserted into MySQL DB,<br>
it sends the request to Asterisk along with the new data (that is inserted<br>
in DB) for making outbound call i.e. Realtime.  Currently I&#39;ve set a cron<br>
job that execute my script every 30 seconds and checks for a new data in<br>
DB. If new data is inserted in 30 seconds that script will run and sends<br>
the data to Asterisk for making calls. (This is the case which I&#39;m thinking<br>
to avoid)  Please advise.<br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.digium.com/pipermail/asterisk-users/attachments/20120919/b8c396a7/attachment.htm" target="_blank">http://lists.digium.com/pipermail/asterisk-users/attachments/20120919/b8c396a7/attachment.htm</a>&gt;<br>

<br>
------------------------------<br></blockquote></div><br clear="all"><br>-- <br>Regards,<br><br>Ahmed Munir Chohan<br><br><br>