Fix the compactheaders option in sip.conf
authorMark Michelson <mmichelson@digium.com>
Thu, 15 Jan 2009 19:16:29 +0000 (19:16 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 15 Jan 2009 19:16:29 +0000 (19:16 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168728 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 7db4d24..99c70f9 100644 (file)
@@ -8055,11 +8055,12 @@ static int add_header(struct sip_request *req, const char *var, const char *valu
                return -1;
        }
 
+       if (sip_cfg.compactheaders) {
+               var = find_alias(var, var);
+
        ast_str_append(&req->data, 0, "%s: %s\r\n", var, value);
        req->header[req->headers] = req->data->str + req->len;
 
-       if (sip_cfg.compactheaders)
-               var = find_alias(var, var);
        req->len += strlen(req->header[req->headers]);
        req->headers++;