[TriLUG] Re: TriLUG Asterisk Routing Project

Kevin Otte nivex at nivex.net
Mon Feb 20 15:41:11 EST 2006


On Mon, Feb 20, 2006 at 01:50:16PM -0500, Tanner Lovelace wrote:
> Cool.  So, it sounds like there are about 3 parts to this.  Please correct me
> if I'm wrong, or if I've left anything out:
> 
> 1. Central TriLUG directory.
>     - Accessible on a trilug web server

Right.  I envision this as just a simple CSV file that can be parsed with a
PHP script.

> 2. AGI script
>     - Available for download on the trilug server
>     - Installed by each Asterisk admin on their local asterisk server

Turns out even AGI may be a bit overkill.  Asterisk has a function called
CURL (so long as curl-dev was present at Asterisk compile time).  So it
could be as simple as:

exten => _5XXX,1,Dial(${CURL(http://trilug.org/voipdir.php?num=${EXTEN:1})})

...and just have voipdir.php return a text/plain document with the callurl.

Of course you may want to use a SetVar(foo=${CURL(...)}) and then do some
sanity checking on foo before actually dialing.  Perhaps have the PHP script
return INVALID and use GotoIf to handle that condition.  There doesn't seem
to be much documentation on how CURL handles other errors though.

Some reference material:
http://www.voip-info.org/wiki/index.php?page=Asterisk+func+curl
http://www.voip-info.org/wiki/view/Asterisk+variables

-- 
Kevin Otte, N8VNR
nivex at nivex.net
http://www.nivex.net/

-=-

"Those who cannot remember the past are condemned to repeat it." 
-- George Santayana

"It seems no one reads Santayana anymore."
-- Cdr. Susan Ivanova, Babylon 5




More information about the TriLUG mailing list