[Asterisk-Users] Extensions.conf sugestion?

Steven Critchfield critch at basesys.com
Fri May 16 11:32:37 MST 2003


My guess is either you have started to develop with a bad idea of how to
represent the data, or you don't understand asterisk that well.

Inside the context you have exten => (EXTENSION),(PRIORITY),(APPLICATION) 
If you followed that, then you should know what to use to tag the
extensions.

Or worse case scenario, since you are writing a config script that
probably will not be able to keep comments in the config after a change
is made, why not use that to your benefit by placing tags before each
extension block and that way you know when you run across a comment
line, it is a tag for your app.

On Fri, 2003-05-16 at 11:51, Dave Packham wrote:
> we are in process of writing a PHP interface for * conf files.  we are parsing the files like INI files but the only prob I have so far is that separate extensions in a context dont have any unique tag that I can capture.
> 
> This works ok
> 
> 
> [trunkld]
> ;
> ; Long distance context accessed through trunk
> ;
> exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN:1})
> exten => _91NXXNXXXXXX,2,Congestion
> 
> [international]
> ;
> ; Master context for international long distance
> ;
> ignorepat => 9
> include => longdistance
> include => trunkint
> 
> 
> 
> This does not, how do I separate the extensions apart from the [default] context so that PHP can modify them seperatly?
> 
> [default]
> ;
> exten => s,1,Background,radsgreet
> ;exten => s,2,Setmusiconhold,default
> ;exten => s,2,Dial,Phone/phone1|20
> exten => t,1,Hangup
> exten => i,1,Playback,invalid
> exten => i,2,Goto,s|1
> 
> ; Dave's Extension
> exten => 70907,1,Dial,SIP/70907|30
> exten => 70907,2,VoiceMail,u70907
> exten => 70907,102,VoiceMail,b70907
> exten => 70907,103,Hangup
> 
> ; Andrew's Extension
> exten => 70902,1,Dial,SIP/70902|30
> exten => 70902,2,VoiceMail,u70902
> exten => 70902,102,VoiceMail,b70902
> exten => 70902,103,Hangup
> 
> 
> Can we add something like this to * that wont kill older versions? so that I can parse out the extensions to be searched on and modified?
> 
> {70907}
> ; Dave's Extension
> exten => 70907,1,Dial,SIP/70907|30
> exten => 70907,2,VoiceMail,u70907
> exten => 70907,102,VoiceMail,b70907
> exten => 70907,103,Hangup
> 
> {70902}
> ; Andrew's Extension
> exten => 70902,1,Dial,SIP/70902|30
> exten => 70902,2,VoiceMail,u70902
> exten => 70902,102,VoiceMail,b70902
> exten => 70902,103,Hangup
> 
> 
> Dave Packham
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Steven Critchfield  <critch at basesys.com>




More information about the asterisk-users mailing list