Skip to content

Commit f3c18ab

Browse files
committed
新增DTMF识别相关接口
1 parent cf2c3cc commit f3c18ab

File tree

2 files changed

+128
-0
lines changed

2 files changed

+128
-0
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,70 @@ This function sets DTMF.
13551355

13561356

13571357

1358+
##### Enable DTMF identification
1359+
1360+
> **voiceCall.dtmfDetEnable(enable)**
1361+
1362+
Enable DTMF identification. It is disabled by default.
1363+
1364+
* Parameter
1365+
1366+
| Parameter | Type | Description |
1367+
| --------- | ------ | ------------------------------------------------------------ |
1368+
| enable | int | 1:Enable DTMF identification, 0:Disable DTMF identification |
1369+
1370+
* Return Value
1371+
1372+
* Returns 0 on success, -1 otherwise.
1373+
1374+
* Example
1375+
1376+
See the example of 'voiceCall.dtmfSetCb()'
1377+
1378+
1379+
1380+
##### set the callback of DTMF identification
1381+
1382+
> **voiceCall.dtmfSetCb(cb)**
1383+
1384+
Set the callback of DTMF identification
1385+
1386+
* Parameter
1387+
1388+
| Parameter | Type | Description |
1389+
| --------- | ------ | ------------------------------------------------------------ |
1390+
| cb | function | callback function |
1391+
1392+
* Return Value
1393+
1394+
* Returns 0 on success, -1 otherwise.
1395+
1396+
* Example
1397+
1398+
```
1399+
>>> def cb(args):
1400+
... print(args)
1401+
...
1402+
...
1403+
...
1404+
>>> voiceCall.dtmfSetCb(cb)
1405+
0
1406+
>>> voiceCall.dtmfDetEnable(1)
1407+
0
1408+
1409+
>>> voiceCall.callStart('13855169092')
1410+
1411+
0
1412+
>>>
1413+
1 //Press "1" on the phone, callback function will receive the pressed character "1".
1414+
1415+
8 //Press "8" on the phone
1416+
1417+
9 //Press "9" on the phone
1418+
```
1419+
1420+
1421+
13581422
##### Set FWmode
13591423

13601424
> **voiceCall.setFw(reason, fwmode, phonenum)**

zh-cn/api/QuecPythonClasslib.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,70 @@ sim.setCallback(cb)
13861386

13871387

13881388

1389+
##### DTMF识别使能接口
1390+
1391+
> **voiceCall.dtmfDetEnable(enable)**
1392+
1393+
DTMF识别使能接口,默认不开启DTMF识别
1394+
1395+
* 参数
1396+
1397+
| 参数 | 参数类型 | 参数说明 |
1398+
| -------- | -------- | ------------------------------------------------------------ |
1399+
| enable | int | 使能开关,取值0/1,0:不开启DTMF识别,1:开启DTMF识别 |
1400+
1401+
* 返回值
1402+
1403+
设置成功返回整型0,设置失败返回整型-1
1404+
1405+
* 示例
1406+
1407+
见voiceCall.dtmfSetCb()接口示例
1408+
1409+
1410+
1411+
##### 设置DTMF识别回调接口
1412+
1413+
> **voiceCall.dtmfSetCb(cb)**
1414+
1415+
设置DTMF识别回调接口
1416+
1417+
* 参数
1418+
1419+
| 参数 | 参数类型 | 参数说明 |
1420+
| -------- | -------- | ------------------------------------------------------------ |
1421+
| cb | function | 回调函数 |
1422+
1423+
* 返回值
1424+
1425+
设置成功返回整型0,设置失败返回整型-1
1426+
1427+
* 示例
1428+
1429+
```
1430+
>>> def cb(args):
1431+
... print(args)
1432+
...
1433+
...
1434+
...
1435+
>>> voiceCall.dtmfSetCb(cb)
1436+
0
1437+
>>> voiceCall.dtmfDetEnable(1)
1438+
0
1439+
1440+
>>> voiceCall.callStart('13855169092')
1441+
1442+
0
1443+
>>>
1444+
1 //手机端按下1,callback中会收到按下的字符“1
1445+
1446+
8 //手机端按下8
1447+
1448+
9 //手机端按下9
1449+
```
1450+
1451+
1452+
13891453
##### 设置控制呼叫转移
13901454

13911455
> **voiceCall.setFw(reason, fwmode, phonenum)**

0 commit comments

Comments
 (0)