<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6001.18023" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Like there's no way to retrieve custom parameters
from SIP headers (AFAIK) I've written a little code wich reading for each SIP
packet the header. If' there are some headers starting with X- then add a
variable of the same name to the concern channel (if
any).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is it a good way?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here is the code I added at the end of </FONT><FONT
face=Arial size=2>handle_request, just before the return.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // Save
customs headers (starting with X-) as variables</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> // if there's
a channel asociated with the
request<BR> if (p->owner)
{<BR>
int
x;<BR>
for (x=0; x<req->headers; x++)
{<BR>
if (!strncasecmp(req->header[x], "X-", 2))
{<BR>
char *name =
ast_strdupa(req->header[x]);<BR>
char *nameptr = strstr(name, ":");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
if (*nameptr)
{<BR>
*nameptr =
0;<BR>
nameptr++;<BR>
pbx_builtin_setvar_helper(p->owner,ast_skip_blanks(name),ast_skip_blanks(nameptr));<BR>
}<BR>
}<BR>
}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>