]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Copy the From header into a variable so that pedantic SIP handling does not try to...
authorJoshua Colp <jcolp@digium.com>
Tue, 3 Jun 2008 19:30:02 +0000 (19:30 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 3 Jun 2008 19:30:02 +0000 (19:30 +0000)
(closes issue #12607)
Reported by: hooi

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@120109 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index afd0c2211cf771c282df2d3f74aff51a81c07f19..47d5a95410a9b4a3d3c6e6ad4c6b5eff20d3a4d9 100644 (file)
@@ -6831,12 +6831,14 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq)
                        return -1;
                }
                from += 4;
+               if (pedanticsipchecking) {
+                       ast_uri_decode(from);
+               }
        } else
                from = NULL;
 
        if (pedanticsipchecking) {
                ast_uri_decode(uri);
-               ast_uri_decode(from);
        }
 
        /* Get the target domain first and user */
@@ -7261,11 +7263,10 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
        while(*t && (*t > 32) && (*t != ';'))
                t++;
        *t = '\0';
-       of = get_header(req, "From");
-       if (pedanticsipchecking)
-               ast_uri_decode(of);
 
-       ast_copy_string(from, of, sizeof(from));
+       ast_copy_string(from, get_header(req, "From"), sizeof(from));
+       if (pedanticsipchecking)
+               ast_uri_decode(from);
        
        memset(calleridname,0,sizeof(calleridname));
        get_calleridname(from, calleridname, sizeof(calleridname));