-
Notifications
You must be signed in to change notification settings - Fork 1
NXphone Android SDK功能说明文档
前言
本文为您介绍了NXphone Android SDK的功能说明以及参数和返回值描述。
SDK使用
NXphone-SDK的项目已开源至Sonatype中央仓库,您可在配置文件中添加jar包依赖如下所示。
Username和Password是您调用NXphone-SDK的账密,可以在牛信云平台生成和管理;
引入工程配置
- 主工程gradle 配置
maven { url 'https://repo1.maven.org/maven2/' }
- app工程gradle配置
implementation 'com.nxcloud.nxphone:sips:0.0.21'
- Module模块enable dataBinding
android {
...
dataBinding {
enabled = true
}
...
}
软功能使用(NxcallSdkUtil)
1)获取NxcallUtil实例。NxcallSdkUtil.getInstance(Context context)
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| context | 是 | Context | 界面activity的引用。 注意不要误用到 application context,要使用当前 activity 的context!!! |
2)设置nxcall电话监听(非必须)。NxcallSdkUtil.setNxcallListener(NxcallListener nxcallListener)
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| nxcallListener | 是 | NxcallListener | 无 |
3)初始化(必须初始化,只能初始化一次)。NxcallSdkUtil.init(Activity activity, View view, Chronometer mChronometer)
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| activity | 是 | Activity | 无 |
| view | 否 | View | 悬浮窗口view,可null |
| mChronometer | 否 | Chronometer | 悬浮窗口时间显示控件,可null |
4)登录账户。boolean nxLogin(String username, String password)
普通登录,速度快,但是选择的牛信话机接入点不一定是最优的,如果有通话问题,需要我们 noc 介入去调节通话质量
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| username | 是 | String | 账户 |
| password | 是 | String | 密码 |
5)测速登录。boolean nxPreLogin(String username, String password)
> 注意,登录、测速登录,只需要选择一种方式即可,不要两种登录一起使用!
牛信全球有很多接入点,测速登录,会花数十秒去自动侦测到每个接入点的网络连接质量,登录上后,是最优通话质量。注意此登录比较耗时。
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| username | 是 | String | 账户 |
| password | 是 | String | 密码 |
6)拨打号码。int nxcall(String number, String orderid)
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| number | 是 | String | 拨打号码,如果为空,自动跳转输入号码界面;如果不为空直接拨号 |
| orderid | 否 | String | 订单ID,客户自定义,用以识别队列;若为空则会自动生成 |
返回值 NxcallStateCode 拨号状态对应返回值
| 返回值 | 说明 |
|---|---|
| 1 | 成功 |
| -1000 | 未登录 |
| -1001 | SIP未连接 |
| -1002 | 正在通话中 |
| -1003 | 拨号码异常 |
7)销毁。void onDestroy()
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| 无 |
- 具体代码步骤示例
1)初始化
NxcallSdkUtil.getInstance(getApplicationContext())
.setNxcallListener(this)
.init(this, null, null);
2)登录
NxcallSdkUtil.getInstance(getApplicationContext())
.nxLogin("username", "password");
3)拨打号码
NxcallSdkUtil.getInstance(getApplicationContext())
.nxcall("number", "orderid");
4)销毁
NxcallSdkUtil.getInstance(getApplicationContext())
.onDestroy();
问题排查
- 是否正确使用了 NxcallSdkUtil.getInstance(mContext).nxLogin()
- 是否项目里有多个 nxcall sdk 版本依赖
- 全局搜索下 nxPreLogin nxLogin ,看是否有多个
Introduction
- Send Message
- Mark Incoming Message as Read
- Upload Media File
- Get Media File
- Delete Media File
- Webhook
- Query Number Information
- Query Message Template
- Create Message Template
- Edit Message Template
- Delete Message Template
- Upload Template Example File
- Embedded Page Login
- Create Client Application
- List of Phone Numbers for Client Application
- Get Verification Code
- Verify Verification Code
- Create Local Client
Short message
Voice
Call Center(NXLink)
- Web Iframe
- Manual Dial Record
- Manual Dial Record Query By orderId
- List Agent Information
- List Agent Status
- List Queue
- List Agents In Queue
- List Agent Efficiency
- Update Queue Agents
- Create AutoDial Task
- Webhook - Manual Dial
AI Agent(NXLink)
- AI Agent Task List
- Query Call Records
- Append Contacts to an Existing Task
- Delete Contacts
- Call Record Callback
Call Center(Callbot)
- Callbot API Summary
- Callbot API Authorization
- Callbot API Ping
- Create Auto Dial Task
- Add Contact List To Task
- Create Task And Add Contact
- Start Or Pause Task
- Update Task Parameters
- Get List Task
- List Call
- List Task Orders
- Stop Order
- Get Call Detail By Order
- Webhook - By Call
- Webhook - By Order
- Webhook - Task Status
Flash Call
Short links
邮件验证码
DID号码
通用
号码检测