[asterisk-users] Execute a script outside Asterisk

Danny Nicholas danny at debsinc.com
Wed Jan 23 08:44:06 CST 2013


Let's assume you're using this snippet

[default]

Exten => s,1,answer()

Exten => s,n,playback(tt-monkeys)

Exten => s,n,waitexten(6)

Exten => s,n,hangup()

Exten => 1,1,AGI(Jonas.php)

Exten => 1,n,playback(vm-goodbye)

Exten => 1,n,hangup()

Exten => 2,1,system(Jonas.php)

Exten => 2,n,playback(vm-goodbye)

Exten => 2,n,hangup()

 

Both of these do the exact same thing - pick up the line, play tt-monkeys,
run Jonas.php if you press 1 or 2, play vm-goodbye and hangup.  The failure
of Jonas.php due to database or any other problem would not affect the
execution of the dialplan.

 

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens
Sent: Wednesday, January 23, 2013 8:32 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Execute a script outside Asterisk

 

Hello,

thank you for your answer.

The most important here is that Asterisk continues with the rest of the
dialplan, in case the database-connection fails or hangs or ...

I don't think the System()-command makes this true.



Jonas.




On 01/23/2013 03:27 PM, Danny Nicholas wrote:

I would vote for system() on two accounts.  #1 AGI requires more overhead
and protocol #2 you are not expecting a result to return to the dialplan. 

 

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens
Sent: Wednesday, January 23, 2013 4:10 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Execute a script outside Asterisk

 

Hello,

at certain time inside my dialplan I would like to have an external php
script executed. Asterisk should not wait for the end of the execution to
continue with the rest of the dialplan. It should just start the execution
of the php script (which inserts an entry into a remote mysql-DB).

What is the best way to work ?

- with AGI inside the dialplan ?
- with the system()-command inside the dialplan ?



Kind regards,
Jonas.






--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello
 
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130123/c2c09443/attachment.htm>


More information about the asterisk-users mailing list