我正在使用 JAIN-SIP-1-2-164。这是应用程序代码:
import java.io.UnsupportedEncodingException;
import java.net.InetAddress;
import java.text.ParseException;
import java.util.*;
import android.os.Handler;
import jain_javax.sip.*;
import jain_javax.sip.address.*;
import jain_javax.sip.header.*;
import jain_javax.sip.message.*;
public class SipLayer implements SipListener {
private SipStack sipStack;
private SipFactory sipFactory;
private Properties properties;
private String local_ip;    
int listen_port;            
/** Here we initialize the SIP stack. */
public SipLayer(int listen_port) {
    try {   
    setUsername(username);
    this.local_ip = InetAddress.getLocalHost().getHostAddress();;
    this.listen_port = listen_port;     
    // Create the SIP factory and set the path name.
    this.sipFactory = SipFactory.getInstance();
    this.sipFactory.setPathName("jain_gov.nist");   
    // Create and set the SIP stack properties.
    this.properties = new Properties();
    this.properties.setProperty("jain_javax.sip.STACK_NAME", "stack");
    this.properties.setProperty("jain_javax.sip.IP_ADDRESS", local_ip);
    if(proxy != null) 
        this.properties.setProperty("jain_javax.sip.OUTBOUND_PROXY", proxy + ':' + server_port + '/' + protocol);
    //DEBUGGING: Information will go to files textclient.log and textclientdebug.log
    this.properties.setProperty("jain_gov.nist.javax.sip.TRACE_LEVEL", "32");
    // this.properties.setProperty("jain_gov.nist.javax.sip.SERVER_LOG", "textclient.txt");
    // this.properties.setProperty("jain_gov.nist.javax.sip.DEBUG_LOG", "textclientdebug.log");
    // Create the SIP stack.
    this.sipStack = this.sipFactory.createSipStack(properties);
  }
  catch (Exception e) {       
    msgProc.processError("SipLayer failed: " + e.getMessage() + "\n");
  }
    }
}
相同的代码在 Windows 机器上的 java 上运行正常,但是我得到了上面提到的错误消息的 android 模拟器。
我发现它未能在“SipStack sipStack = (SipStack) sipStackConstructor.newInstance(conArgs);”处遵循 Jain SIP 1.2 例程
private SipStack createStack(Properties properties)
        throws PeerUnavailableException {
    try {
        // create parameters argument to identify constructor
        Class[] paramTypes = new Class[1];
        paramTypes[0] = Class.forName("java.util.Properties");
        // get constructor of SipStack in order to instantiate
        Constructor sipStackConstructor = Class.forName(
                getPathName() + ".jain_javax.sip.SipStackImpl").getConstructor(
                paramTypes);
        // Wrap properties object in order to pass to constructor of
        // SipSatck
        Object[] conArgs = new Object[1];
        conArgs[0] = properties;
        // Creates a new instance of SipStack Class with the supplied
        // properties.
        SipStack  sipStack = (SipStack) sipStackConstructor.newInstance(conArgs);
        sipStackList.add(sipStack);
        String name = properties.getProperty("jain_javax.sip.STACK_NAME");
        this.sipStackByName.put(name, sipStack);
                    return sipStack;
    } catch (Exception e) {
        String errmsg = "The Peer SIP Stack: "
                + getPathName()
                + ".jain_javax.sip.SipStackImpl"
                + " could not be instantiated. Ensure the Path Name has been set.";
        throw new PeerUnavailableException(errmsg, e);
    }
}
任何建议或如何进一步调试?