[Asterisk-Users] Filling PHP Variable from EXTENSION in AGI

Brancaleoni Matteo mbrancaleoni at espia.it
Sun Aug 31 04:12:42 MST 2003


Il sab, 2003-08-30 alle 22:40, romsun p ha scritto:
> Hellooo...

hi
> 
> Is it possible to fill a variable of PHP-based-AGI-script
> from dialed extension ?
yes
> 
> This is what I need to achieve:
> If someone dial an extension, say 777, 
> I want the dialed extension (777) be filled into 
> PHP variable.   I need the dialed extension become
> a condition of PHP script.

as soon as you start the script with AGI(scriptname),
asterisk sends out some vars via std input to the script.
just read that output from the script, parse it and you'll
have your dialled extension, along with other vars.
See app_agi.c to get what vars are sent by asterisk to the agi
script. 
agi_extension is what you need (contains the dialled number)

I wrote a little function in php that reads this output, parse
it and put it into an assoc array, so I can have all
the vars in a single & easy array.


> 
> Help please...
> Thanks
> 
> romsun
> _________________________________________________________
> This mail sent using V-webmail - http://www.v-webmail.org
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Brancaleoni Matteo <mbrancaleoni at espia.it>
Espia - Emmegi Srl




More information about the asterisk-users mailing list