AGI Sample – Passing argument to AGI

How to pass argument from dialplan to AGI

Bellow I show a simple example:

[ext-local-custom]

exten => *778,1,AGI(testAgi.php|255)
exten => *778,n,hangup

now create a php file (testAgi.php) in /var/lib/asterisk/agi-bin and run:

chwon asterisk:asterisk testAgi.php
chmod 755 testAgi.php

here is the content of the file:

#!/usr/bin/php -q
say_number($a);
?> 

You may also like