--- chan_sip.c 2007-07-23 10:32:07.000000000 -0400 +++ chan_sip_fix.c 2007-12-01 15:30:51.000000000 -0500 @@ -2983,9 +2983,26 @@ * Anyways, pedanticsipchecking controls whether we allow spaces before ':', * and we always allow spaces after that for compatibility. */ - for (pass = 0; name && pass < 2;pass++) { - int x, len = strlen(name); + + /*Find Last Authorization Line*/ + int tmplen = 13; + int x; + char tmpchar[13] = "Authorization"; + + if (!strncasecmp(tmpchar,name,tmplen)) { for (x=*start; xheaders; x++) { + if (!strncasecmp(req->header[x], name, tmplen)) { + *start=x; + } + } + /* ast_verbose("Checking Multiple Authorization Lines, Starting At Header#: %u\n", x); */ + } + + + for (pass = 0; name && pass < 2;pass++) { + int len = strlen(name); + for (x=*start; xheaders; x++) { + if (!strncasecmp(req->header[x], name, len)) { char *r = req->header[x] + len; /* skip name */ if (pedanticsipchecking)