Git Product home page Git Product logo

ipccsdk-python's Introduction

ipccSDK-python Demo


ipcc呼叫中心sdk

interpretation


API 说明
out_call 发起通用外呼
notify 发起通知型呼叫(语音通知)
hungup 挂机
play 播放语音文件/TTS
stop_play 通知播放当前语音/TTS
transfer 呼叫转接
multi_play 播放多段语音/TTS
upload_voice_file 上传语音文件

Before you begin


  • 需要自己准备好回调URL

  • 向腾讯云申请开通 云呼叫中心 功能

  • 记录腾讯云分配的测试号码及appid

  • 呼叫中心采用ip白名单及appid鉴权机制,故您需要向腾讯云提供能的测试/生产环境的ip

Usage


Installation

$> cd ipccSDK-python
$> python setup.py install
$> pip install -r requirements.txt

Example

修改example.py 代码中的配置

appid = "turing-test"  # 申请的appid
host = "http://172.17.0.10"  # 分配的ipcc server
number = "9512345" # 分配的测试号码

运行 example.py

$> python example.py

Documentation


中文文档

Quick Start


创建ipcc client

from ipcc.client import Client
client = Client(host, appid)

发起通用呼叫

client.out_call(number, "13800138000")

发起通知型呼叫

client.notify(number, "13800138000", "我的梦想是世界和平")

挂机

client.hungup(callid)

播放语音/TTS

# flag=1为播放录音文件模式,对应voice需传入语音文件路径
# flag=0为播放tts模式,对应voice需传入文本
client.play(callid, flag, voice)

停止当前播放

client.stop_play(callid)

转接

client.transfer(callid, called, voice)

上传录音文件

client.upload_voice_file(file_path, file_name)

ipcc事件回调


ipcc处理事件之后会有相应的通知事件回调到调用服务器, 开发者可根据具体需求对事件进行处理。具体可参照ipccSDK-python/server/server.py中的相应代码进行开发。

Callback url

POST /v1/ipcc/callback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.