[Asterisk-Dev] Retrieving variable set by SetVar() in extensions.conf

Alf Thomas Nilsen a-t-n at online.no
Wed Mar 30 06:09:13 MST 2005


I am trying to add some functionality to Asterisk that will allow one to
define a payload size for any given codec and/or channel. As it is today,
each codec has a hardcoded size in the source code. I have thought that the
best way to do this would be to have a variable set to the wanted size in
extensions.conf using SetVar(). However, I am new to Asterisk and I'm having
a hard time understanding the source code. Therefore I am not sure how to
retrieve the variables I set using SetVar() inside the source code (let's
say, rtp.c for example). I guess it's possible since predefined variables
like SIP_CODEC exists.

 

In pseudo, this is what I'd like to do:

 

Extensions.conf: SetVar(size=30);

Rtp.c : wanted_size = extensions.conf -> size;

 

As far as I've understood this variable can then have a different value for
each active channel since it's not a GlobalVar.

 

Thanks in advance for any help regarding this matter

 

Best regards,

Alf Thomas Nilsen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20050330/b8ef18ad/attachment.htm


More information about the asterisk-dev mailing list