python/lua/java等语言通过ESL执行freeswit的APP

Song2006 次浏览0个评论2018年11月09日

python/lua/java等语言通过ESL执行freeswit的APP

一、为什么要通过ESL执行freeswit的APP

因为有时候在ESL链接的过程中需要操作一些APP的功能,而不是API的功能,使用不能使用api()来执行。

二、使用什么方式执行APP

python/lua/java等语言通过ESL执行freeswit的APP

1、execute

python可以使用如下方法实现:

connect.execute(handle, "start_dtmf", uuid);

其他语言可以参考

esl_execute(&handle, "start_dtmf","" , uuid);

例子,我要实现ESL执行内置脚本的detect_speech

#!/usr/bin/python
# -*- coding:utf8 -*-
from ESL import *

connect = ESLconnection("127.0.0.1", "0", "0")
if connect.connected:
    e = connect.recvEvent()
    if e:
        uuid = e.getHeader('Channel-Call-UUID')
        connect.execute("detect_speech","stop",uuid)

2、excuteAsync

方法与excute一样,不过他是异步执行。

提交评论

请登录后评论

用户评论

    当前暂无评价,快来发表您的观点吧...

更多相关好文

    当前暂无更多相关好文推荐...