oifayulian / sipme-media-server

Automatically exported from code.google.com/p/sipme-media-server
0 stars 1 forks source link

Telephone-event format 97 support #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Media server could not handle with Media Format:97 telephone-event.  When  
incoming  SDP Offer  contains  rtpmap:97  telephone-event/8000,   the replied 
SDP Answer doesn't contains this  Media Attribute type.   Then cause fail to 
detect DTMF on that call session.

To solve this issue
Yulian Oifa suggest  making the following change:
In 
https://code.google.com/p/sipme-media-server/source/browse/io/rtp/src/main/java/
ua/mobius/media/server/impl/rtp/sdp/RTPFormats.java#192
Change from
for (int i = 0; i < this.rtpFormats.size(); i++) {
    for (int j = 0; j < other.size(); j++) {

        if (this.rtpFormats.get(i).getFormat().matches(other.rtpFormats.get(j).getFormat())) {
                        if(this.rtpFormats.get(i).getFormat().getName().equals(AVProfile.telephoneEvent.getName()))                            
                                res.add(this.rtpFormats.get(i));                    
                        else if(!hasNonDtmf)
                        {
                                res.add(this.rtpFormats.get(i));
                                hasNonDtmf=true;
                        }
                }
    }
}

To:
for (int i = 0; i < this.rtpFormats.size(); i++) {
    if(this.rtpFormats.get(i).getFormat().getName().equals(AVProfile.telephoneEvent.getName()))                            
        res.add(this.rtpFormats.get(i));
    else if(!hasNonDtmf)
    {      
        for (int j = 0; j < other.size() && !hasNonDtmf; j++) {
            if (this.rtpFormats.get(i).getFormat().matches(other.rtpFormats.get(j).getFormat()))
                        {
                                res.add(this.rtpFormats.get(i));
                                hasNonDtmf=true;
                        }
                }
    }
}

Original issue reported on code.google.com by anakes1...@gmail.com on 13 Oct 2014 at 1:55