[Asterisk-Users] Extensions.conf sugestion?

Dave Packham dave.packham at utah.edu
Fri May 16 12:53:21 MST 2003


The web interface we have now presents you with all the different extension contexts that we have

[oncampus]
exten => 70901,yada
exten => 70902,yada

[offcampus]
exten => 70903,yada
exten => 70904,yada

[restricted]
exten => 70905,yada
exten => 70906,yada

etc

when you click on "oncampus" you are presented with all the extensions in that context.  in this case 70901 and 70902.  

the page then will show you ALL the text including comments in the that pertain to extension 70901 & 2 

I may not see/understand as you put it how I can include all the comments and definitions that should be included with the 70901 if I dont delimit it somehow?

how would I group the "dpackham" extension 70901 and keep comments if I have no real deliliter? 

;dpackham
exten => 70901,yada
exten => 70901,yada2
;this is a comment for 70901
;
;this is going to stay here for 70902
;the is for andrew
exten => 70902,yada
exten => 70902,yada2
exten => 70902,yada3
;and this too for 70902
exten => 70902,yada4
;
;


I cant think of a statement that will allow me to include/group the comments and extra text with an extension except by defining a start/end pair.

<70902>
;this is going to stay here
exten => 70902,yada
exten => 70902,yada2
exten => 70902,yada3
;and this too
exten => 70902,yada4
</70902>

is this any clearer?

or an I just loosing it? 

I thougt I was understanding it pretty clearly.  I just want to write a interface that wont trash the conf files by stripping comments and whitespace etc.

Dave




>>> critch at basesys.com 5/16/2003 12:32:37 PM >>>
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>

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com 
http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list