首页 文章

如何通过域而不是IP地址注册到SIP服务器并从客户端创建SIP帐户?

提问于
浏览
0

我已经成功编译了Android的Liblinphone库并使用它注册到Brekeke SIP服务器并在Android客户端和PC客户端(x-Lite,linphone)之间进行调用 . 但我面临两个问题:

  • 客户端使用其IP地址而不是域注册到服务器 .

例如:如果服务器IP:192.168.10.105和客户端(IP,名称):( 192.168.10.101,101),用户将注册到Brekeke作为sip:101@192.168.10.101而不是sip:101@192.168.10.105所以当我从linphone客户端拨打101时,结果是Not Found

try{
    from = LinphoneCoreFactory.instance()
          .createLinphoneAddress("sip:101@192.168.10.105");

    proxy_cfg = LinphoneCoreFactory.instance().createProxyConfig
                ("sip:101@192.168.10.105","sip:"+from.getDomain(),null,true);

} catch (LinphoneCoreException e) {
    FileLog.e("proxy_cfg error",e);
}

LinphoneAuthInfo info;
info = LinphoneCoreFactory.instance().createAuthInfo(from.getUserName(),
        "password",null,"sip:"+from.getDomain()); 

mLinphoneCore.addAuthInfo(info);

try {
    mLinphoneCore.addProxyConfig(proxy_cfg);
} catch (LinphoneCoreException e) {
  FileLog.e("reg error",e);
}

mLinphoneCore.setDefaultProxyConfig(proxy_cfg);
  • 我需要在客户端通过代码在SIP服务器上创建用户,这可能是使用Liblinphone还是我自己应该实现它?

1 回答

  • 0

    只需使用DNS SRV即可跟踪客户端IP

相关问题