marc
marc

Reputation: 1

Perform a web look up from Asterisk dial plan?

I have a text file that I would like to access and use in a dial plan. What is the syntax for accessing the file from within the dial plan?

Something like:

Dial(tech/service/[http://textfile])

Upvotes: 0

Views: 1845

Answers (2)

simone cittadini
simone cittadini

Reputation: 338

Since it seems you have already made the file accessible from a web server you can use the asterisk curl function :

You'll probably need to recompile asterisk after installing the curl dev libraries, http://www.voip-info.org/wiki/index.php?page=Asterisk+func+curl

Then you can :

exten => s,1,Set(dest=${CURL(http://textfile)})  
exten => s,2,Dial(SIP/${dest})

Upvotes: 2

recluze
recluze

Reputation: 1915

You can try to create an AGI script (in PHP, C, Java whatever language) and call that from the dialplan:

exten => _x,n,AGI(your-script.php)

You can then do all sorts of stuff in that script. If you can provide more details of what you're trying to do, guys on StackOverflow can probably guide you better.

Upvotes: 1

Related Questions