[Kamailio-Users] Question regarding config file operation

elias baixas elias.baixas at voztele.com
Wed Nov 12 00:36:01 CET 2008


Hi Siddhardha,

you're very brave for trying to understand the yacc/flex part of  
kamailio ! in fact that took me the most effort but also was very  
rewarding :)

in fact the cfg.y defines a parser for configuration files, the parser  
is integrated into kamailio executable by linking kamailio with  
cfg.tag.o and lex.yy.o. Then kamailio will be able to interpret  
whatever config file you tell it, and when it parses the config file,  
it generates the correct 'routing structures' internally.... you can  
think of it as a domain-specific programming-language in which  
Kamailio is the interpreter: every configuration file you feed  
kamailio with is like a small 'program' that tells it how to create  
the internal routes.... and this is at run-time, not compile time. if  
you look, you'll see that kamailio does _not_ link to kamailio.cfg  
that is where the routes are defined: this file is scanned when you  
start kamailio.

as you'll know, yacc  (or bison) is used to create parsers for  
programming languages and other 'complex' configuration files (usually  
when they need to have recursive structures, otherwise you should have  
enough with a lexer and something simpler).


so: you don't need to rebuild openser when you change openser.cfg.   
You would need to rebuild it if you changed cfg.y or cfg.lex (in that  
case, you would be changing the grammar for configuration files).

hope it helps.

ELias


El 11/11/2008, a las 15:59, Siddhardha Garige escribió:

>
> Hello all,
>
> I have a basic question regarding config file operation.
>
> Here is my understanding. At build time bison and flex work on  
> config file and generates cfg.tab.c. This file is equivalent to c  
> version of config file. Make uses cfg.tab.c along with other files  
> and loads a series of actions into action structures. These actions  
> will be performed on messages in a predefined order.
>
> If i make a change to config file, do I have to rebuild openser? But  
> I do see just by stopping and starting these changes get reflected  
> in operation. How does these changes get into action structure with  
> out bison and flex generating cfg.tab.c file and make compiling with  
> other files?
>
> Any help in this regard is appreciated.
>
> Thanks
> Sid
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20081112/a423c129/attachment.htm 


More information about the Users mailing list