]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix my previous fix
authorMartin Pycko <martinp@digium.com>
Mon, 31 Mar 2003 16:26:37 +0000 (16:26 +0000)
committerMartin Pycko <martinp@digium.com>
Mon, 31 Mar 2003 16:26:37 +0000 (16:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@728 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 186fa42fb0b297c4b88d58c2c455201125481c86..87e2f1325c984de3894f82e65618110d12e3e461 100755 (executable)
@@ -1493,14 +1493,14 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
        ast_rtp_pt_clear(p->rtp);
        codecs = m + len;
        while(strlen(codecs)) {
-               if (sscanf(codecs, "%d %n", &codec, &len) != 1) {
+               if (sscanf(codecs, "%d%n", &codec, &len) != 1) {
                        ast_log(LOG_WARNING, "Error in codec string '%s'\n", codecs);
                        return -1;
                }
                ast_rtp_set_m_type(p->rtp, codec);
                codecs += len;
-               /* Fix going to: a=rtpmap:0 PCMU/8000 line */
-               if ( (int)(strlen(m)-(int)(codecs-m)) < 0 ) break;
+               /* Skip over any whitespace */
+               while(*codecs && (*codecs < 33)) codecs++;
        }
 
        // Next, scan through each "a=rtpmap:" line, noting each