|
@@ -19,6 +19,7 @@ import com.wdkl.app.ncs.callingdoor.R;
|
|
import com.wdkl.app.ncs.callingdoor.activity.CallActivity;
|
|
import com.wdkl.app.ncs.callingdoor.activity.CallActivity;
|
|
import com.wdkl.app.ncs.callingdoor.settings.SettingConfig;
|
|
import com.wdkl.app.ncs.callingdoor.settings.SettingConfig;
|
|
import com.wdkl.ncs.android.lib.base.BaseApplication;
|
|
import com.wdkl.ncs.android.lib.base.BaseApplication;
|
|
|
|
+import com.wdkl.ncs.android.lib.utils.ExtendMethodsKt;
|
|
import com.wdkl.ncs.android.middleware.common.Constant;
|
|
import com.wdkl.ncs.android.middleware.common.Constant;
|
|
import com.wdkl.ncs.android.middleware.common.MessageEvent;
|
|
import com.wdkl.ncs.android.middleware.common.MessageEvent;
|
|
|
|
|
|
@@ -121,7 +122,7 @@ public class WdklSipService extends Service {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- Toast.makeText(WdklSipService.this, message, Toast.LENGTH_SHORT).show();
|
|
|
|
|
|
+ ExtendMethodsKt.showMessage(message);
|
|
Log.d("sipCall", ">>>>>>>>>>>> call state: " + state + ", " + call.getRemoteAddress().asString());
|
|
Log.d("sipCall", ">>>>>>>>>>>> call state: " + state + ", " + call.getRemoteAddress().asString());
|
|
|
|
|
|
if (state == Call.State.IncomingReceived || state == Call.State.IncomingEarlyMedia) {
|
|
if (state == Call.State.IncomingReceived || state == Call.State.IncomingEarlyMedia) {
|
|
@@ -143,25 +144,25 @@ public class WdklSipService extends Service {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
|
|
+ /*@Override
|
|
public void onRegistrationStateChanged(Core core, ProxyConfig cfg, RegistrationState state, String message) {
|
|
public void onRegistrationStateChanged(Core core, ProxyConfig cfg, RegistrationState state, String message) {
|
|
if (!SettingConfig.getSipEnabled(BaseApplication.appContext)) {
|
|
if (!SettingConfig.getSipEnabled(BaseApplication.appContext)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
EventBus.getDefault().post(new MessageEvent(state, Constant.EVENT_SIP_REGISTER_STATUS));
|
|
EventBus.getDefault().post(new MessageEvent(state, Constant.EVENT_SIP_REGISTER_STATUS));
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
};
|
|
};
|
|
|
|
|
|
-// try {
|
|
|
|
-// //复制一些源资源
|
|
|
|
-// //默认配置只能在首次时安装一次
|
|
|
|
-// copyIfNotExist(R.raw.linphonerc_default, basePath + "/.wdkl_sip_rc");
|
|
|
|
-// //用户配置,每次复制
|
|
|
|
-// copyFromPackage(R.raw.linphonerc_factory, "wdkl_sip_rc");
|
|
|
|
-// } catch (IOException ioe) {
|
|
|
|
-// Log.e("sipCall",ioe.getMessage());
|
|
|
|
-// }
|
|
|
|
|
|
+ try {
|
|
|
|
+ //复制一些源资源
|
|
|
|
+ //默认配置只能在首次时安装一次
|
|
|
|
+ copyIfNotExist(R.raw.linphonerc_default, basePath + "/.wdkl_sip_rc");
|
|
|
|
+ //用户配置,每次复制
|
|
|
|
+ copyFromPackage(R.raw.linphonerc_factory, "wdkl_sip_rc");
|
|
|
|
+ } catch (IOException ioe) {
|
|
|
|
+ Log.e("sipCall",ioe.getMessage());
|
|
|
|
+ }
|
|
|
|
|
|
//创建SIP核心并加载监听器
|
|
//创建SIP核心并加载监听器
|
|
mCore = Factory.instance()
|
|
mCore = Factory.instance()
|