aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-23 20:52:19 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-23 20:52:19 +0000
commitf2baadc1ee93b8beb04f8ab5c3e8046262c6d9b1 (patch)
treeb129ab8e15d39f2b863037d386428faa1eaa5227 /channels
parent78fcee1973b2dcae43b59e708bb5e96fc6328e73 (diff)
Merged revisions 166696 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r166696 | tilghman | 2008-12-23 14:47:08 -0600 (Tue, 23 Dec 2008) | 7 lines Allow semicolons and extended characters in user-specified SIP headers. (closes issue #14110) Reported by: gork Patches: 20081222__bug14110__2.diff.txt uploaded by Corydon76 (license 14) Tested by: gork, putnopvut ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@166697 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 441080d9b..09fd55979 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22008,7 +22008,7 @@ static int sip_addheader(struct ast_channel *chan, void *data)
int no = 0;
int ok = FALSE;
char varbuf[30];
- char *inbuf = data;
+ char *inbuf = data, *subbuf;
if (ast_strlen_zero(inbuf)) {
ast_log(LOG_WARNING, "This application requires the argument: Header\n");
@@ -22022,13 +22022,18 @@ static int sip_addheader(struct ast_channel *chan, void *data)
snprintf(varbuf, sizeof(varbuf), "__SIPADDHEADER%.2d", no);
/* Compare without the leading underscores */
- if( (pbx_builtin_getvar_helper(chan, (const char *) varbuf + 2) == (const char *) NULL) )
+ if ((pbx_builtin_getvar_helper(chan, (const char *) varbuf + 2) == (const char *) NULL)) {
ok = TRUE;
+ }
}
if (ok) {
- pbx_builtin_setvar_helper (chan, varbuf, inbuf);
- if (sipdebug)
+ size_t len = strlen(inbuf);
+ subbuf = alloca(len + 1);
+ ast_get_encoded_str(inbuf, subbuf, len + 1);
+ pbx_builtin_setvar_helper(chan, varbuf, subbuf);
+ if (sipdebug) {
ast_debug(1, "SIP Header added \"%s\" as %s\n", inbuf, varbuf);
+ }
} else {
ast_log(LOG_WARNING, "Too many SIP headers added, max 50\n");
}