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: "Bryant Zimmerman" <<a href="mailto:BryantZ@zktech.com">BryantZ@zktech.com</a>><br>
Subject: Re: [asterisk-users] Trigger Asterisk after data inserted in<br>
mysql<br>
To: "Asterisk Users Mailing List - Non-Commercial Discussion"<br>
<<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>><br>
Message-ID: <4d5734ed$7d50d85e$77bd1cd6$@<a href="http://zktech.com" target="_blank">zktech.com</a>><br>
Content-Type: text/plain; charset="us-ascii"<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: "David Cook" <<a href="mailto:dbc_asterisk@advan.ca">dbc_asterisk@advan.ca</a>><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>
>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('sudo /home/sarbac/hello_world ','Sarbajit'); 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>
<<a href="mailto:ahmedmunir007@gmail.com">ahmedmunir007@gmail.com</a>> 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>
<CAGMN=JdbE5FdDSQXxZ9OrWXu3Pvgc-hj-EnPxUrG=<a href="mailto:RJHGSD-eg@mail.gmail.com">RJHGSD-eg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1" 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'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'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'm thinking<br>
to avoid) Please advise.<br>
<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<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>><br>
<br>
------------------------------<br></blockquote></div><br clear="all"><br>-- <br>Regards,<br><br>Ahmed Munir Chohan<br><br><br>