[Devel] new textops functions

Klaus Darilion klaus.mailinglists at pernau.at
Fri Nov 25 10:02:31 CET 2005


Hi Daniel!


How do I tell my module that the insert_hf function is found in the 
textops module?

regards
klaus


Daniel-Constantin Mierla wrote:
> Hello Klaus,
> 
> you have to fill a xl_elem_t structure and give the pointer as the 
> second parameter.
> 
> xl_elem_t xe;
> 
> memset(&xe, 0, sizeof(xl_elem_t));
> xe.text.s = header_to_add;
> xe.text.len = strlen (header_to_add);
> 
> insert_hf(msg, (char *)&xe, 0 );
> 
> Cheers,
> Daniel
> 
> 
> On 11/24/05 12:05, Klaus Darilion wrote:
> 
>> Hi Daniel!
>>
>> Thanks for the new features. How can I use these functions from 
>> another module? (I have the new header as string (or str) and want to 
>> use insert_hf from textops.)
>>
>> Should I copy the whole functions into my module?
>>
>> regards
>> klaus
>>
>> Daniel-Constantin Mierla wrote:
>>
>>> Hello,
>>>
>>> there are a set of new functions added to textops module:
>>> - insert_hf(txt) - inserts the 'txt' as header before the first 
>>> header of the SIP message
>>> - insert_hf(txt, hdr) - inserts the 'txt' as header before the first 
>>> 'hdr' header of the SIP message
>>> - append_hf(txt, hdr) - adds the 'txt' as header after the first 
>>> 'hdr' header of the SIP message
>>>
>>> The 'txt' parameter can contain pseudo-variables which will be 
>>> replaced at run time.
>>>
>>> For the existing function 'append_hf(txt)' was added support for 
>>> pseudo-variables in 'txt' parameter as well. This functions adds the 
>>> 'txt' as header after the last header of the SIP message.
>>>
>>> Note that if some other functions inserts headers in different 
>>> positions (e.g., record_route()), so the result will be according to 
>>> the order of using such functions.
>>>
>>> To give an example, if you want to add a header composed from src-ip 
>>> and src port just after From header:
>>>
>>> append_hf("From-addr: $si:$sp\r\n", "From");
>>>
>>> Updated documentation for textops module:
>>> http://openser.org/docs/modules/1.1.x/textops.html
>>>
>>> The list with pseudo-variables:
>>> http://openser.org/docs/pseudo-variables-1.1.x.html
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openser.org
>>> http://openser.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>>
> 
> 




More information about the Devel mailing list