mirror of
https://github.com/asterisk/asterisk.git
synced 2026-06-25 18:06:40 -07:00
automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@8431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
+4
-9
@@ -12926,14 +12926,11 @@ static int sip_dtmfmode(struct ast_channel *chan, void *data)
|
||||
/*! \brief sip_addheader: Add a SIP header ---*/
|
||||
static int sip_addheader(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int arglen;
|
||||
int no = 0;
|
||||
int ok = 0;
|
||||
char *content = (char *) NULL;
|
||||
char varbuf[128];
|
||||
|
||||
arglen = strlen(data);
|
||||
if (!arglen) {
|
||||
if (ast_strlen_zero((char *)data)) {
|
||||
ast_log(LOG_WARNING, "This application requires the argument: Header\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -12942,14 +12939,12 @@ static int sip_addheader(struct ast_channel *chan, void *data)
|
||||
/* Check for headers */
|
||||
while (!ok && no <= 50) {
|
||||
no++;
|
||||
snprintf(varbuf, sizeof(varbuf), "_SIPADDHEADER%.2d", no);
|
||||
content = pbx_builtin_getvar_helper(chan, varbuf);
|
||||
|
||||
if (!content)
|
||||
snprintf(varbuf, sizeof(varbuf), "_SIPADDHEADER%02d", no);
|
||||
if (ast_strlen_zero(pbx_builtin_getvar_helper(chan, varbuf + 1)))
|
||||
ok = 1;
|
||||
}
|
||||
if (ok) {
|
||||
pbx_builtin_setvar_helper (chan, varbuf, data);
|
||||
pbx_builtin_setvar_helper (chan, varbuf, (char *)data);
|
||||
if (sipdebug)
|
||||
ast_log(LOG_DEBUG,"SIP Header added \"%s\" as %s\n", (char *) data, varbuf);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user