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;
}