0
votes

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])

2

2 Answers

2
votes

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})
1
votes

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.