tommo
tommo

Reputation: 1350

How to run asterisk dialplan commands from outside of asterisk

How would we run the asterisk command such as PITCH_SHIFT from PHP or asterisk manager?

This is for editing call state from outside of asterisk, via web interface.

Upvotes: 0

Views: 1118

Answers (4)

Luan Freitas
Luan Freitas

Reputation: 21

Use Fastagi

Implements the Asterisk Gateway Interface (AGI) over TCP sockets. This can help alleviate CPU load on your telephony server by relocating resource hungry scripts to another networked server. In order to instruct Asterisk to attempt a network connection, you must supply the hostname or IP address of the server where your FastAGI service is hosted and preface it with agi

http://www.voip-info.org/wiki/view/Asterisk+FastAGI

Upvotes: 0

sedwards
sedwards

Reputation: 24

The previous answers (mel, and partially arheops) are incorrect. AGI (normal or fast) executes from the dialplan -- kind of like a macro or a subroutine. There is no way to execute an AGI outside of Asterisk*.

A normal AGI executes as a separate process from Asterisk, but Asterisk creates it, manages STDIN and STDOUT, and passes the AGI environment to the process via STDIN.

A fast AGI is similar, but instead of creating a process, Asterisk creates a TCP connection to an existing process -- thus, it is 'faster' than creating a process that may have substantial startup overhead -- cough, cough, java, cough, oracle, cough, cough.

*) Actually, you can execute an AGI outside of Asterisk, but this is a pretty advanced debugging technique -- feed a previously 'recorded' AGI dialog to STDIN while you step through your code in a debugger. You can't interact with Asterisk, but you can hit databases, watch code, change variables, etc.

Upvotes: 1

mel
mel

Reputation: 501

You can use AGI. One of the popular library is PHPAGI

Upvotes: 1

arheops
arheops

Reputation: 15247

IF you use ami, you need use redirect to dialplan which have such command.

You can use that with asterisk realtime config to change dialplan acordinly.

Other solution is use Fast(AGI).

Upvotes: 1

Related Questions