[asterisk-dev] Accessing SIP Headers from within a module

Josh josh at sentrix.co.uk
Wed Aug 14 10:36:04 CDT 2013


Dear Asterisk-Dev, 

Apologies if this isn't the right place, I'm mainly looking for a pointer
on how to access sip headers from within app_voicemail.c, unfortunately I'm 
using asterisk 1.4 (duck!). Is this possible? I have seen the function

func_header_read(chan, NULL, "diversion", diversion, 100);

which is declared static in chan_sip.c so I can't use it.
Copying the important parts from the routine gives me the
following:

struct sip_pvt *p;
p = chan->tech_pvt;
sip_req *req = (sip_req *)p->initreq; // doesn't compile
ast_log(LOG_WARNING, "DATA:%s",&p->initreq->header[0]); // doesn't work as above. 

Is there another way to access these? A function already? Any help/pointer
would be amazing, 

thanks for your time, 

Josh

-- 



More information about the asterisk-dev mailing list