[asterisk-dev] SIPAdd/RemoveHeader apps
russell at digium.com
Fri Jan 16 09:27:37 CST 2009
Tilghman Lesher wrote:
> On Friday 16 January 2009 03:35:25 Johansson Olle E wrote:
>> Functions are built to return a value. Adding a header doesn't return
>> a value, so addheader doesn't really make sense to put in a function.
>> Removing a header could return true or false.
> Not all methods of a function return a value. You're neglecting the write
> portion of a function, which returns no value. If you set a header to contain
> no value, I think that should be equivalent to deleting it.
This is pretty much what I had in mind originally. Reading headers
would work as it does today, but the write version of the function would
be the same as SIPAddHeader, unless the value is empty, in which case it
would do what SIPRemoveHeader does.
Add -> Set(SIP_HEADER(myheader)=foo)
Remove -> Set(SIP_HEADER(myheader)=)
Of course, as you said, if you want a status indicator on your attempt
at removing a header, it's not going to fit into a function.
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org
More information about the asterisk-dev