Sazzad Kamal
2011-Oct-18 07:08 UTC
[asterisk-users] How does Asterisk parse extensions.conf file?
Hello, I want to know the way Asterisk parses configuration files. So that I can find out, what Asterisk does when I write, 'allow=g711' in extensions.conf file. As I've come to know, Asterisk configuration files are kind of DSLs. I thought it must have a parser to know the values in those conf files, i.e., the value of 'allow' parameter. Can anyone please tell me what functions/files are used to parse these configuration files? Sincerely, Sazzad Bin Kamal -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111018/01722728/attachment.htm>
Sazzad Kamal
2011-Oct-18 08:37 UTC
[asterisk-users] How does Asterisk parse extensions.conf file?
I see, it is pbx_ael.c . But I'm unable to see the 'allow=codec' part any where. ________________________________ From: Sazzad Kamal <sazzad_bin_kamal at yahoo.com> To: "asterisk-users at lists.digium.com" <asterisk-users at lists.digium.com> Sent: Tuesday, October 18, 2011 1:08 PM Subject: How does Asterisk parse extensions.conf file? Hello, I want to know the way Asterisk parses configuration files. So that I can find out, what Asterisk does when I write, 'allow=g711' in extensions.conf file. As I've come to know, Asterisk configuration files are kind of DSLs. I thought it must have a parser to know the values in those conf files, i.e., the value of 'allow' parameter. Can anyone please tell me what functions/files are used to parse these configuration files? Sincerely, Sazzad Bin Kamal -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111018/936d0883/attachment.htm>
Tzafrir Cohen
2011-Oct-18 09:42 UTC
[asterisk-users] How does Asterisk parse extensions.conf file?
On Tue, Oct 18, 2011 at 12:08:04AM -0700, Sazzad Kamal wrote:> Hello, > > I want to know the way Asterisk parses configuration files. So that I can find out, what Asterisk does when I write, 'allow=g711' in extensions.conf file. > > As I've come to know, Asterisk configuration files are kind of DSLs.AEL is. Calling the configuration files a DSL (Domain-Specific Language) is a bit streching it. The format of the file itself is very simple. The dialplan can be more complex, though.> I thought it must have a parser to know the values in those conf files, i.e., the value of 'allow' parameter.Let's see: In the shell: # echo allow=g711 >>/etc/asterisk/extensions.conf In the CLI: sweetmorn*CLI> dialplan reload Dialplan reloaded. [Oct 18 11:33:38] WARNING[31241]: pbx_config.c:1595 pbx_load_config: ==!!== Unknown directive: allow at line 941 -- IGNORING!!! Are you sure you're after that file? This is indeed an invalind configuration. Can you give us a hint as to what you're after?> > Can anyone please tell me what functions/files are used to parse these configuration files?pbx/pbx_config.c , main/config.c Hint: grep '"extensions\.conf"' */*.c Also, if you don't have the source: $ grep 'extensions\.conf' /usr/sbin/asterisk /usr/lib/asterisk/modules/*.so Binary file /usr/lib/asterisk/modules/pbx_config.so matches Binary file /usr/lib/asterisk/modules/res_ael_share.so matches $ strings /usr/lib/asterisk/modules/res_ael_share.so | grep 'extensions\.conf' (You may ignore this warning if '%s' exists in extensions.conf, or is created by another module. I cannot check for those.) This is only a simple message, not the one we're looking for. $ strings /usr/lib/asterisk/modules/res_ael_share.so | grep 'extensions\.conf' does give the expected output. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir