<div dir="ltr">A design principle of Asterisk is that channel technology-specific details are only obtainable from the channel driver for that technology.<div style><br></div><div style>Trying to transplant functions from chan_sip.c into app_voicemail.c is going to lead to, well let's just say, pain :).</div>
<div style><br></div><div style>What you're better off doing is trying to get data from the SIP header from within chan_sip.c when a SIP request arrives. You can then save that information on the ast_channel, potentially using a channel variable (see pbx_builtin_setvar_helper() and pbx_builtin_getvar_helper() in include/asterisk/pbx.h). This way, the data will be available on the channel itself in app_voicemail.c.</div>
<div style><br></div><div style>Good luck!</div><div style>Mark Michelson</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 14, 2013 at 10:36 AM, Josh <span dir="ltr"><<a href="mailto:josh@sentrix.co.uk" target="_blank">josh@sentrix.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Dear Asterisk-Dev,<br>
<br>
Apologies if this isn't the right place, I'm mainly looking for a pointer<br>
on how to access sip headers from within app_voicemail.c, unfortunately I'm<br>
using asterisk 1.4 (duck!). Is this possible? I have seen the function<br>
<br>
func_header_read(chan, NULL, "diversion", diversion, 100);<br>
<br>
which is declared static in chan_sip.c so I can't use it.<br>
Copying the important parts from the routine gives me the<br>
following:<br>
<br>
struct sip_pvt *p;<br>
p = chan->tech_pvt;<br>
sip_req *req = (sip_req *)p->initreq; // doesn't compile<br>
ast_log(LOG_WARNING, "DATA:%s",&p->initreq->header[0]); // doesn't work as above.<br>
<br>
Is there another way to access these? A function already? Any help/pointer<br>
would be amazing,<br>
<br>
thanks for your time,<br>
<br>
Josh<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</font></span></blockquote></div><br></div>