[OpenSIPS-Devel] [opensips] Bug on Mediaproxy Module (#242)

danielzt notifications at github.com
Thu May 22 16:05:08 CEST 2014


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

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

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.

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

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

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

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

    return True;
}
```

SIP messages where the problem happens (IPs changed).

INV_ORIG
```
INVITE sip:980679523 at 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" <sip:238 at 200.200.200.200>;tag=78c43725-748598
To: <sip:980679523 at 200.200.200.200:5060;user=phone>
Call-ID:D1B9-1113-467485981252A8227AA6-579 at SipHost
CSeq:292 INVITE
Contact:<sip:238 at 192.168.0.2:5060>
Expires:90
Max-Forwards:69
Proxy-Authorization:Digest username="238",realm="200.200.200.200",nonce="324234234",uri="sip:980679523 at 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
```

INV_DST
```
INVITE sip:5521980679523 at 111.111.111.111 SIP/2.0
Record-Route: <sip:200.200.200.200;lr;ftag=78c43725-748598;did=d6.16983383>
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" <sip:238 at 200.200.200.200>;tag=78c43725-748598
To: <sip:980679523 at 200.200.200.200:5060;user=phone>
Call-ID:D1B9-1113-467485981252A8227AA6-579 at SipHost
CSeq:292 INVITE
Contact:<sip:238 at 211.211.211.211:24843>
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
```

Session Progress where problem happened:
```
SIP/2.0 183 Session Progress
From: "238"<sip:238 at 200.200.200.200>;tag=78c43725-748598
To: <sip:980679523 at 200.200.200.200:5060;user=phone>;tag=9331612363958214899
Call-ID: D1B9-1113-467485981252A8227AA6-579 at 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: <sip:5521980679523 at 111.111.111.111;user=phone>
Supported: timer,100rel
Record-Route: <sip:111.111.111.111:5060;lr>
Record-Route: <sip:200.200.200.200;lr;ftag=78c43725-748598;did=d6.16983383>
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
```

When Opensips forward the Invite to originator, it changes the Media IP to None as below:
```
SIP/2.0 183 Session Progress
From: "238"<sip:238 at 200.200.200.200>;tag=78c43725-748598
To: <sip:980679523 at 200.200.200.200:5060;user=phone>;tag=9331612363958214899
Call-ID: D1B9-1113-467485981252A8227AA6-579 at SipHost
CSeq: 292 INVITE
Via: SIP/2.0/UDP 192.168.0.2:5060;received=211.211.211.211;rport=24843;branch=z9hG4bK1dd777c32231bc7f
Contact: <sip:5521980679523 at 111.111.111.111;user=phone>
Supported: timer,100rel
Record-Route: <sip:111.111.111.111:5060;lr>
Record-Route: <sip:200.200.200.200;lr;ftag=78c43725-748598;did=d6.16983383>
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
```

After this, originator CANCEL the call.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/242
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140522/6af823c7/attachment-0001.htm>


More information about the Devel mailing list