<p>I'm having some specific customers that this problem below when Opensips receive the 200 OK reply or 183 with SDP:</p>

<p>May 21 16:18:05 xxxxx sbin/opensips[22385]: WARNING:mediaproxy:use_media_proxy: broken client. Called UA added extra media stream(s) in the OK reply</p>

<p>Then Opensips sends 200 OK to the originator, but change media IP address to "None" and call fails. This happens everytime a specific equipment place a call, the weird part is that the error is seen on 200 OK (or 183 Session progress), that is sent by destination.</p>

<p>The solution is to comment some lines on method get_cseq_number from Mediaproxy module as below:</p>

<pre><code>static Bool
get_cseq_number(struct sip_msg *msg, str *cseq)
{
//    struct cell *trans = tm_api.t_gett();

//    if (msg-&gt;first_line.type == SIP_REPLY &amp;&amp; trans != NULL &amp;&amp; trans != T_UNDEFINED) {
//        cseq-&gt;s = trans-&gt;cseq_n.s+CSEQ_LEN;
//        cseq-&gt;len = trans-&gt;cseq_n.len-CSEQ_LEN;
//    } else {
        if (msg-&gt;cseq == NULL) {
            if (parse_headers(msg, HDR_CSEQ_F, 0)==-1) {
                LM_ERR("cannot parse CSeq header\n");
                return False;
            }
            if (msg-&gt;cseq == NULL) {
                LM_ERR("missing CSeq header\n");
                return False;
            }
        }
        *cseq = get_cseq(msg)-&gt;number;
//    }

    if (cseq-&gt;s==NULL || cseq-&gt;len==0) {
        LM_ERR("missing CSeq number\n");
        return False;
    }

    return True;
}
</code></pre>

<p>SIP messages where the problem happens (IPs changed).</p>

<p>INV_ORIG</p>

<pre><code>INVITE sip:980679523@200.200.200.200:5060;user=phone SIP/2.0
Allow:INVITE,ACK,OPTIONS,BYE,CANCEL,INFO,PRACK,REFER,SUBSCRIBE,NOTIFY,UPDATE
Via:SIP/2.0/UDP 192.168.0.2:5060;branch=z9hG4bK1dd777c32231bc7f
From: "238" &lt;sip:238@200.200.200.200&gt;;tag=78c43725-748598
To: &lt;sip:980679523@200.200.200.200:5060;user=phone&gt;
Call-ID:D1B9-1113-467485981252A8227AA6-579@SipHost
CSeq:292 INVITE
Contact:&lt;sip:238@192.168.0.2:5060&gt;
Expires:90
Max-Forwards:69
Proxy-Authorization:Digest username="238",realm="200.200.200.200",nonce="324234234",uri="sip:980679523@200.200.200.200:5060;user=phone",response="234234234"
Supported:replaces
User-Agent:dlink 12-37-61928258-0.9.5.1.735
Content-Type:application/sdp
Content-Length:312

v=0
o=238 1855793670 1855793670 IN IP4 192.168.0.2
s=Session SDP
c=IN IP4 192.168.0.2
t=0 0
m=audio 9000 RTP/AVP 18 4 2 0 8 101
a=rtpmap:18 G729/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:2 G726-32/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000/1
a=fmtp:101 0-15
</code></pre>

<p>INV_DST</p>

<pre><code>INVITE sip:5521980679523@111.111.111.111 SIP/2.0
Record-Route: &lt;sip:200.200.200.200;lr;ftag=78c43725-748598;did=d6.16983383&gt;
Allow:INVITE,ACK,OPTIONS,BYE,CANCEL,INFO,PRACK,REFER,SUBSCRIBE,NOTIFY,UPDATE
Via: SIP/2.0/UDP 200.200.200.200:5060;branch=z9hG4bK6b66.10b5efe6.0
Via:SIP/2.0/UDP 192.168.0.2:5060;rport=24843;received=211.211.211.211;branch=z9hG4bK1dd777c32231bc7f
From: "238" &lt;sip:238@200.200.200.200&gt;;tag=78c43725-748598
To: &lt;sip:980679523@200.200.200.200:5060;user=phone&gt;
Call-ID:D1B9-1113-467485981252A8227AA6-579@SipHost
CSeq:292 INVITE
Contact:&lt;sip:238@211.211.211.211:24843&gt;
Expires:90
Max-Forwards:69
Supported:replaces
User-Agent:dlink 12-37-61928258-0.9.5.1.735
Content-Type:application/sdp
Content-Length: 316
P-hint: NAT

v=0
o=238 1855793670 1855793670 IN IP4 192.168.0.2
s=Session SDP
c=IN IP4 200.200.200.200
t=0 0
m=audio 45430 RTP/AVP 18 4 2 0 8 101
a=rtpmap:18 G729/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:2 G726-32/8000/1
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000/1
a=fmtp:101 0-15
</code></pre>

<p>Session Progress where problem happened:</p>

<pre><code>SIP/2.0 183 Session Progress
From: "238"&lt;sip:238@200.200.200.200&gt;;tag=78c43725-748598
To: &lt;sip:980679523@200.200.200.200:5060;user=phone&gt;;tag=9331612363958214899
Call-ID: D1B9-1113-467485981252A8227AA6-579@SipHost
CSeq: 292 INVITE
Via: SIP/2.0/UDP 200.200.200.200:5060;branch=z9hG4bK6b66.10b5efe6.0;sent-by="111.111.111.111:5060"
Via: SIP/2.0/UDP 192.168.0.2:5060;received=211.211.211.211;rport=24843;branch=z9hG4bK1dd777c32231bc7f
Contact: &lt;sip:5521980679523@111.111.111.111;user=phone&gt;
Supported: timer,100rel
Record-Route: &lt;sip:111.111.111.111:5060;lr&gt;
Record-Route: &lt;sip:200.200.200.200;lr;ftag=78c43725-748598;did=d6.16983383&gt;
Content-Type: application/sdp
Content-Length: 302

v=0
o=MG4000|2.0 746 957 IN IP4 111.111.111.111
s=-
c=IN IP4 111.111.111.111
t=0 0
m=audio 50152 RTP/AVP 18 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=ptime:20
a=X-vrzcap:vbd Ver=0 Mode=FaxPr ModemRtpRed=0
a=X-vrzcap:identification bin=DSR2879 Prot=mgcp App=MG
</code></pre>

<p>When Opensips forward the Invite to originator, it changes the Media IP to None as below:</p>

<pre><code>SIP/2.0 183 Session Progress
From: "238"&lt;sip:238@200.200.200.200&gt;;tag=78c43725-748598
To: &lt;sip:980679523@200.200.200.200:5060;user=phone&gt;;tag=9331612363958214899
Call-ID: D1B9-1113-467485981252A8227AA6-579@SipHost
CSeq: 292 INVITE
Via: SIP/2.0/UDP 192.168.0.2:5060;received=211.211.211.211;rport=24843;branch=z9hG4bK1dd777c32231bc7f
Contact: &lt;sip:5521980679523@111.111.111.111;user=phone&gt;
Supported: timer,100rel
Record-Route: &lt;sip:111.111.111.111:5060;lr&gt;
Record-Route: &lt;sip:200.200.200.200;lr;ftag=78c43725-748598;did=d6.16983383&gt;
Content-Type: application/sdp
Content-Length: 293

v=0
o=MG4000|2.0 746 957 IN IP4 111.111.111.111
s=-
c=IN IP4 None
t=0 0
m=audio 50152 RTP/AVP 18 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=ptime:20
a=X-vrzcap:vbd Ver=0 Mode=FaxPr ModemRtpRed=0
a=X-vrzcap:identification bin=DSR2879 Prot=mgcp App=MG
</code></pre>

<p>After this, originator CANCEL the call.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/OpenSIPS/opensips/issues/242'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxNjM4NjcwOCwiZGF0YSI6eyJpZCI6MzI4NjE0NDF9fQ==--7ca2eec6f864e900a64d831ef12bc4eddbecdce6.gif' height='1' width='1'></p>