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

Matthew Jordan mjordan at digium.com
Wed Sep 4 17:02:46 CDT 2013


On Wed, Sep 4, 2013 at 3:41 PM, Joshua Colp <jcolp at digium.com> wrote:

> George Joseph wrote:
>
>>
>> Gotcha.  If you give me some naming convention guidance, I can work on
>> both the SIP equivalents and config stuff (which would be needed to
>> duplicate SIPPEER anyway) using PJSIP_DIAL_CONTACTS and
>> PJSIP_MEDIA_OFFER as templates.
>>
>
> Changing the names is a minor thing, so just go with what feels right.
> Note: We have no peers though.
>
>
My personal preference (although I'm certainly open to any alternatives):

SIPPEER -> PJSIP_ENDPOINT
SIP_HEADER -> PJSIP_HEADER (thoughts below on this)
SIPCHANINFO -> PJSIP_CHAN_INFO

As far as SipAddHeader/SipRemoveHeader go - it always felt a little wonky
that these were dialplan applications, particularly when we have SIP_HEADER
as a function. It feels like this could be easily:

${PJSIP_HEADER(X-foo)} - equivalent to SIP_HEADER
Set(PJSIP_HEADER(X-foo)=bar) - equivalent to SipAddHeader
Set(PJSIP_HEADER(X-foo)=) - equivalent to SipRemoveHeader

The last one is the most tricky, as it is debatable whether or not certain
headers (such as Allow) can be empty. If we need to allow empty headers,
another option would be to explicitly specify 'remove' as the second
parameter to the function:

Set(PJSIP_HEADER(X-foo,remove)=)

Just some thoughts.

It'd be fantastic for someone to contribute those patches - let us know if
you need any help/pointers!

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130904/ae4ca5e3/attachment.htm>


More information about the asterisk-dev mailing list