Helping me script

dear all,

I having problem how to make script for like this i have ext 12345 and i have PHP form with text box and submit button for example at text box i type 123 and submit it, that call ext 12345 when it’s hang up by user the user can listening like this “Please come to may room 123 (one two three) <where 123 can be change from text box at form>” may be like at mailbox function how to make this??? does any body can helping me!!!

It should be fairly easy to do this. You would have your PHP page drop a call file in /var/spool/asterisk/outgoing. The call file would point to an extension that uses an agi script to playback the message.

I’m newbie at here can u give me example for may problem??? … o-dial+out has example .call files has info on how to make Asterisk use external scripts via AGI

what you’d want to do is make an extension that does nothing but call your AGI script.


exten => 9999,1,AGI(yourscript.php)

then make your .call file call the remote caller and send them to myagiscript, 9999, 1

thank you for answer it. And how to make voice like may pass paremeter???

you can also call from a php page :

$socket = fsockopen("YOUR SERVER IP","5038", $errno, $errstr,$timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret: XXXX\r\n\r\n");
fputs($socket, "Action: Originate\r\n");
fputs($socket, "Channel: Sip/12345\r\n");
fputs($socket, "Context: fromweb\r\n" );
fputs($socket, "Exten: 12345\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "Variable:room=123|\r\n\r\n" );

You have to enable the manager (if you don’t know how search in

In extensions.conf you need to have something like this


Hope it help