[asterisk-dev] Any plans for func_config to use sorcery?

George Joseph george.joseph at fairview5.com
Wed Sep 4 13:12:02 CDT 2013


On Wed, Sep 4, 2013 at 10:32 AM, Joshua Colp <jcolp at digium.com> wrote:
>
> George Joseph wrote:
>>
>> Right now, func_config (which provides AST_CONFIG) isn't working well
>> with pjsip.conf because there can be multiple sections with the same
>> name (but different types).   Is there a plan to port func_config to use
>> sorcery or maybe create a new function which does?   I can contribute
>> time and code if given some direction.
>
>
> There's no current issue open to do so, and porting func_config to use sorcery wouldn't really make sense as they are completely separate beasts.
>
> Sorcery instances are also not currently shared within the system so you'd have to have a dialplan function specific to the user of sorcery (like the new SIP stuff) which exposes things. Doing so isn't that hard as sorcery already provides a mechanism to take a sorcery object and turn it into a key value pair. Use the object type and identifier to find the object, turn it into the key value pair, return what you want to the dialplan. Just have to make sure that the object is unreferenced so it doesn't (potentially) leak.
>
> That all being said... how are you using this information in the dialplan / why are you looking to expose it?
>

I use AST_CONFIG from lua to retrieve info from users.conf.   I
created a fork of the AsteriskGUI for my customers and have been
transforming it to not use global variables in extensions.conf to
store user specific data.  Happily, pbx_config could care less if
there are parameters in a users context that it doesn't recognize and
AST_CONFIG reads them just fine.  This gives me 1 easily accessible
place to store user data.

I do have work-arounds though...  I could create a separate config
file and at least get the data out of extensions.conf.  This is
probably the 'correct' option anyway.  I could also use a naming
convention in pjsip.conf so the objects all have unique names
(user-ep, user-aor, etc). AST_CONFIG works fine with that convention.
I was also trying to use setvar in the users context at one point but
if you need to set more than one you can't manipulate them from AMI
very well.

On related notes...
What's the plan for SIPPEER, SIP_HEADER, SIPCHANINFO, SipAddHeader,
SipRemoveHeader, etc.  They're all provided by chan_sip and I don't
see any pjsip equivalents.

How about users.conf?  Any plan to have pbx_config create pjsip
objects instead of, or as well as, sip objects?



More information about the asterisk-dev mailing list