3

Using Mjsip as the sip stack for my softphone project. There is class RtpSender.java has Method

public RtpSender(OutputStream output_stream, boolean do_sync, SIPCodec sipCodec, DatagramSocket src_socket, String dest_addr, int dest_port )
    {
        init( output_stream, do_sync, sipCodec, src_socket, dest_addr, dest_port );
    }

In another file AudioSender.java (this is a pure-java audio stream sender) I use that RtpSender method as follows...

sender=new RtpSender(audio_input_stream,true,**SIPCodec**,null,daddr,dport);

My problem is the SIPCodec, I have a interface named that for the codecs, what value I should pass r how should i pass? I am calling the codecids but it is showing method is not appropiate for this. Here is the codec interface...

public interface SIPCodec {
// Codec constants
public static String MEDIA_TYPE_AUDIO = "audio";
public static String MEDIA_TYPE_VIDEO = "video";
public static String ATTRIBUTE_PTIME = "ptime";
public static String ATTRIBUTE_RTPMAP = "rtpmap";
public static String ATTRIBUTE_FMTP = "fmtp";
public static String ATTRIBUTE_AS = "AS";
public static int DEFAULT_PACKETIZATION = 20;
public void encodeInit( int defaultEncodePacketization );
public void decodeInit( int defaultDecodePacketization );
...

And here is the codecs.java class from where I call the individual codecs.

public SIPCodec getSIPAudioCodec( int codecId ) {

        SIPCodec sipCodec;

        switch ( codecId ) {
            case audioCodecPCMU:
                sipCodec = new SIPCodecPCMU();
                break;
            case audioCodecPCMA:
                sipCodec = new SIPCodecPCMA();
                break;
            case audioCodecG729:
                sipCodec = new SIPCodecG729();
                break;
            case audioCodeciLBC:
                sipCodec = new SIPCodeciLBC();
                break;
            default:
                sipCodec = null;
        }
B770
  • 1,272
  • 3
  • 17
  • 34
S. M. Shahinul Islam
  • 2,780
  • 4
  • 36
  • 68
  • HI Alvi_1987 I am using MjSip lib but I can't register on server please help me on this http://stackoverflow.com/questions/10636157/mjsip-register-the-client-on-asterisk-server#comment13804499_10636157 – Sunny May 18 '12 at 17:53

0 Answers0