[asterisk-dev] Questions before I wrap up res_pjsip_header_funcs

George Joseph george.joseph at fairview5.com
Thu Sep 12 15:56:19 CDT 2013


To recap...  This module implements PJSIP_HEADER, PJSIPAddHeader and
PJSIPRemoveHeader.

If you don't like the module name, let me know now. :)

Questions...

Is there really no way to read the string value of an arbitrary pjsip
header?  There's pjsip_generic_string_header which has a hvalue, but
that's only a parent for the non-frequent headers.  All the more
frequent ones have their own structures which you have to know at
compile time.  I.E.  You're asking for the "From" header so you know
the structure is going to be a pjsip_from_hdr.   For arbitrary
headers, my only option seems to be to call the header's print_to
function (which they all implement) to a buffer then trim off the
leading header name and ': '.  Any other ideas?

Also, is there any way to get the pj_pool from the ast_channel passed
to an app or function implementation?  I'm using a pjsip_msg structure
to accumulate the outgoing headers and most of the helper functions
for pjsip need the pool.

george



More information about the asterisk-dev mailing list