freeswitch ws php,针对FreeSwitch的呼叫中心接口
針對FreeSwitch的呼叫中心接口
tags:FSGUI FreeSwitch 接口 呼叫中心接口 創建時間:2018-12-21 11:37:35
座席登且獲取相關信息
__author__ = 'lihao,18621575908'
#https://github.com/websocket-client/websocket-client
import websocket
try:
import thread
except ImportError: # TODO use Threading instead of _thread in python3
import _thread as thread
import time
import sys
import json
def on_message(ws, message):
print(message)
def on_error(ws, error):
print(error)
def on_close(ws):
print("### closed ###")
def on_open(ws):
def run(*args):
s = '{"Agent":"8000","Password":"1234","Extension":"1001"}'
ws.send(s)
time.sleep(1)
thread.start_new_thread(run, ())
if __name__ == "__main__":
websocket.enableTrace(True)
if len(sys.argv) < 2:
host = "ws://139.196.40.50:8084/fsgui"
else:
host = sys.argv[1]
ws = websocket.WebSocketApp(host,
on_message=on_message,
on_error=on_error,
on_close=on_close)
ws.on_open = on_open
ws.run_forever()
##除登錄認證或單獨說明外,其它的接口均為控制,則回應值
###正常的為:"code": "0", "msg": "successed", "sessionid": uuid
###不正常的為: "code": "1", "msg": "failed", "sessionid": uuid
###屬于沒注冊的或token失效則為: "Not Authorized"
附加接口,坐席登錄后獲得事件或cdr
websocket地址: host = "ws://139.196.40.50:8084/fsgui"
送的認證模塊數據: '{"Agent":"8000","Password":"1234","Extension":"1001"}'
那么就會源源不斷地從遠程服務器獲得數據
1 token 認證:
返回值: "token":"token code"
非正常返回值: "Not Authorized"
curl -d '{"username": "admin", "password": "admin"}' -H "Content-Type:application/json" http://192.168.1.115:8082/api/login
2 獲取一個系統生成的uuid:
正常返回值:”result":"success","uuid":uuid
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/get_uuid
3. 設置分機忙閑
//idle or busy
//idle意為設置為閑
//busy意為設置為忙
curl -H "Content-Type: application/json" -d '{"Extension":"1002","Value":"idle" }' -H "Authorization:Nway token " http://192.168.1.115:8085/api/extension_seatstatus
4. 設置分機上線下線
//up or down
//up為上線
//down為下線
curl -H "Content-Type: application/json" -d '{"Extension":"1002","Value":"up" }' -H "Authorization:Nway token " http://192.168.1.115:8085/api/extension_seatstate
5. 設置分機呼叫狀態
//ring,talking,ivr,ready
//ring 振鈴中
//talking通話中
//ivr 語音導航中
//ready 準備就緒,可以通話
curl -H "Content-Type: application/json" -d '{"Extension":"1002","Value":"ring" }' -H "Authorization:Nway token " http://192.168.1.115:8085/api/extension_callstate
6. 查詢分機狀態
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/extension_info/1002
7 獲取一個正在通話中的電話的uuid:
正常返回值:”result":"success","uuid":uuid
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/get_phone_uuid/1002
8 掛斷一個正通話中電話
正常返回值:”result":"success","info":hangupcause
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/hangup/1002
9 hold一個通話
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/hold/1002
10 unhold一個通話
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/unhold/1002
11 發起一個呼叫
//Job_uuid 源主叫uuid get_uuid獲得
Callername sip里的name
Callernum aleg 號碼
Calleenum bleg 號碼
A_gatewayname 如果a是外線,則要指定a的出局網關
B_gatewayname 如果b是外線,則要指定b的出局網關
A_effective_caller_id_num a到b顯示的號碼
B_effective_caller_id_num b到a在a上顯示的號碼
A_external false,true,標記a是不是外線
B_external false,true,標記b是不是外線
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"1002","Callernum":"1002","Calleenum":"1000","A_gatewayname":"","B_gatewayname":"","A_effective_caller_id_num":"1002","B_effective_caller_id_num":"1000","A_external":"false","B_external":"false"}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/originate
11b 呼叫兩個通道且放音,originate_playring
這個接口可以替代原上一個接口originage,即我們不指定播放的ring_id即可
Job_uuid 源主叫uuid get_uuid獲得
Callername sip里的name
Callernum aleg 號碼
Calleenum bleg 號碼
A_gatewayname 如果a是外線,則要指定a的出局網關
B_gatewayname 如果b是外線,則要指定b的出局網關
A_effective_caller_id_num a到b顯示的號碼
B_effective_caller_id_num b到a在a上顯示的號碼
A_external false,true,標記a是不是外線
B_external false,true,標記b是不是外線
Ring_id , 上傳后的彩鈴id,在這里以字符串發送
先呼內線再呼外線
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"1001","Callernum":"1001","Calleenum":"018621575908","A_gatewayname":"nwaycall","B_gatewayname":"nwaycall","A_effective_caller_id_num":"18621575908","B_effective_caller_id_num":"13671947488","A_external":"false","B_external":"true","Ring_id":"35"}' -H "Authorization:Nway token" http://127.0.0.1:8085/api/originate_playring
先呼外線再呼內線
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"18621575908","Callernum":"018621575908","Calleenum":"1001","A_gatewayname":"nwaycall","B_gatewayname":"nwaycall",
"A_effective_caller_id_num":"18621575908",
"B_effective_caller_id_num":"13671947488","A_external":"true","B_external":"false","Ring_id":"35"}' -H "Authorization:Nway token" http://127.0.0.1:8085/api/originate_playring
兩線均為外線
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"18621575908","Callernum":"018621575908","Calleenum":"013671947488","A_gatewayname":"nwaycall","B_gatewayname":"nwaycall","A_effective_caller_id_num":"18621575908","B_effective_caller_id_num":"13671947488","A_external":"true","B_external":"true","Ring_id":"35"}' -H "Authorization:Nway token" http://127.0.0.1:8085/api/originate_playring
11c 發起時由調用方指定呼叫事件和cdr的post URL
Job_uuid 源主叫uuid get_uuid獲得
Callername sip里的name
Callernum aleg 號碼
Calleenum bleg 號碼
A_gatewayname 如果a是外線,則要指定a的出局網關
B_gatewayname 如果b是外線,則要指定b的出局網關
A_effective_caller_id_num a到b顯示的號碼
B_effective_caller_id_num b到a在a上顯示的號碼
A_external false,true,標記a是不是外線
B_external false,true,標記b是不是外線
Ring_id , 上傳后的彩鈴id,在這里以字符串發送
Cdr_url , 當遇到有cdr時,應post到的地址
Event_url , 當有消息事件時,應post到的地址
返回值:
成功: w.WriteJson(map[string]string{"code": "1", "msg": "BackMsg_19", "sessionid": myOri.Job_uuid})
失敗: w.WriteJson(map[string]string{"code": "2", "msg": "BackMsg_20", "sessionid": myOri.Job_uuid})
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"1002","Callernum":"1002",
"Calleenum":"1000","A_gatewayname":"","B_gatewayname":"","A_effective_caller_id_num":"1002",
"B_effective_caller_id_num":"1000","A_external":"false","B_external":"false","Ring_id":"35",
"Cdr_url":"http://123.1.2.2/cdr/","Event_url":"http://123.1.2.2/event/"}'
-H "Authorization:Nway token" http://192.168.1.115:8085/api/originate_yn
11d 采用fsgui中配的網關組呼叫
從配的GatewayGroupId中的網關中隨機獲取一個gateway,然后進行a路和b路的呼叫,其它值同11c
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"1002","Callernum":"1002",
"Calleenum":"1000","A_effective_caller_id_num":"1002","GatewayGroupId":"1",
"B_effective_caller_id_num":"1000","A_external":"false","B_external":"false","Ring_id":"35",
"Cdr_url":"http://123.1.2.2/cdr/","Event_url":"http://123.1.2.2/event/"}'
-H "Authorization:Nway token" http://192.168.1.115:8085/api/originate_ext
11e 呼叫外線后轉內部座席組或ivr等
這里是通過我們的應用來實現,把平臺呼出外線反作為外線呼入來處理,從而可以更方便地進行功能擴展
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callername":"1002","Callernum":"1002",
"GroupNum":"8000","A_gatewayname":"nway",
"A_effective_caller_id_num":"1002","
"B_effective_caller_id_num":"1000","A_external":"false", "Ring_id":"35"}'
-H "Authorization:Nway token" http://192.168.1.115:8085/api/originate_to_group
11f 呼出后轉系統路由
curl -H "Content-Type: application/json" -d '{"Job_uuid":"1234","Callernum":"1002",
"Calleenum":"1000","A_gatewayname":"","A_effective_caller_id_num":"1002",
"B_effective_caller_id_num":"1000","A_external":"false"}'
-H "Authorization:Nway token" http://192.168.1.115:8085/api/to_dialplan
11g. 轉給外呼機器人接口
curl -H "Content-Type: application/json" -d '{"Job_uuid":"feew32223dd3e32re32e32", "Callernum":"18621575908", "Calleenum":"999888", "A_gatewayname":"nway1", "A_effective_caller_id_num":"021168686868", "A_external":"true",
"Cdr_url":"http://127.0.0.1:8085/fs/cdr", "Event_url":"http://127.0.0.1:8085/fs/callstate", "Record_file":"mytest.wav"}' -H "Authorization:Nway TOKEN" http://127.0.0.1:8085/api/originate_i
11h. 呼叫給電話機器人時,進行回鈴檢測
curl -H "Content-Type: application/json" -d '{"Job_uuid":"feew32223dd3e32re32e32", "Callernum":"18621575908", "Calleenum":"999888", "A_gatewayname":"nway1", "A_effective_caller_id_num":"021168686868", "A_external":"true", "Cdr_url":"http://127.0.0.1:8085/fs/cdr", "Event_url":"http://127.0.0.1:8085/fs/callstate", "Record_file":"mytest.wav"}' -H "Authorization:Nway TOKEN" http://127.0.0.1:8085/api/originate_i_da
11i. 呼叫后轉給自動回應
curl -H "Content-Type: application/json" -d '{"Job_uuid":"feew32223dd3e32re32e32", "Callernum":"18621575908", "A_gatewayname":"nway1", "A_effective_caller_id_num":"021168686868", "A_external":"true"}' -H "Authorization:Nway TOKEN" http://127.0.0.1:8085/api/originate_echo
11j. 呼叫后轉放音
curl -H "Content-Type: application/json" -d '{"Job_uuid":"feew32223dd3e32re32e32", "Callernum":"18621575908", "A_gatewayname":"nway1", "A_effective_caller_id_num":"021168686868", "A_external":"true","Filename":"/hold.wav"}' -H "Authorization:Nway TOKEN" http://127.0.0.1:8085/api/originate_playback
11k. 呼叫后轉給自動park
curl -H "Content-Type: application/json" -d '{"Job_uuid":"feew32223dd3e32re32e32", "Callernum":"18621575908", "A_gatewayname":"nway1", "A_effective_caller_id_num":"021168686868", "A_external":"true"}' -H "Authorization:Nway TOKEN" http://127.0.0.1:8085/api/originate_park
12 按uuid橋接兩個通話通道
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
A_uuid A的uuid
B_uuid B的uuid
curl -H "Content-Type: application/json" -d '{"A_uuid":"aleguuid","B_uuid":"bleguuid"}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/bridge
13 按號碼橋接兩個通話通道
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
```
同上,把uuid直接使用號碼
```
curl -H "Content-Type: application/json" -d '{"A_phone":"1002","B_phone":"1003"}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/bridge_phone
14 park一個通話
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
掛起一個號碼
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/park/1002
15 搶接一個來電
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
把最后一個來電搶接過來
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/intercept/1002
16 由平臺應答
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/answer/1002
17 按號碼監聽
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
EvdedPhone 被監聽的號碼
EvdPhone 由哪個號碼監聽
EvdGateway 如果是外線號碼進行監聽,則需要指定網關
curl -H "Content-Type: application/json" -d '{"EvdedPhone":"1002","EvdPhone":"1003","EvdGateway":""}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/eavesdrop
18 多方通話
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
為了減少代碼量,所以使用了和監聽一樣的名稱
EvdedPhone 邀請加入多方通話的的號碼
EvdPhone 邀請加入的多方通話里有哪個號碼在通話
EvdGateway 如果是外線號碼,則需要指定網關
curl -H "Content-Type: application/json" -d '{"EvdedPhone":"1002","EvdPhone":"1003","EvdGateway":""}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/threeway
19 耳語
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
為了減少代碼量,所以使用了和監聽一樣的名稱
EvdedPhone 被監聽的的號碼
EvdPhone 監聽的號碼
EvdGateway 如果是外線號碼,則需要指定網關
curl -H "Content-Type: application/json" -d '{"EvdedPhone":"1002","EvdPhone":"1003","EvdGateway":""}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/whisper
20 preanswer
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token. . " http://192.168.1.115:8085/api/preanswer/1002
21 給已answer的通道放音
```
PhoneNumber 準備放音的號碼
FilePath 語音文件路徑
Loopplay 不間斷循環
```
curl -H "Content-Type: application/json" -d '{"PhoneNumber":"1002","FilePath":"D:\nwaytest.wav","Loopplay":"true"}' -H "Authorization:Nway . . " http://192.168.1.115:8085/api/playback
22 中止相關操作
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/break/1002
23 錄音
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
PhoneNumber 準備錄音的號碼
FilePath 語音文件路徑
Flag 開始就錄制
Limit 0即通話哪怕是一秒也錄制,如果是5,則如果通話低于5就不保存
curl -H "Content-Type: application/json" -d '{"PhoneNumber":"1002","Filepath":"nwaytestr.wav","Flag":"start","Limit":"0"}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/record
24 發送dtmf
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
```
PhoneNumber 準備發送dtmf的號碼
Dtmf dtmf
```
curl -H "Content-Type: application/json" -d '{"PhoneNumber":"1002","Dtmf":"18621575908"}' -H "Authorization:Nway token " http://192.168.1.115:8085/api/senddtmf
25 發送傳真
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
```
PhoneNumber 目標號碼
GatewayName gw名稱,如果為空,則只是發到內線的
FaxFile 傳真文件名,是轉成的tiff文件
```
curl -H "Content-Type: application/json" -d '{"PhoneNumber":"02112345678","GatewayName":"fax","FaxFile","/tmp/av.tiff" }' -H "Authorization:Nway token " http://192.168.1.115:8085/api/send_fax
26 轉接
正常返回值:”result":"success","info":returnstr
不正常返回值:”result":"failed"
為了減少代碼量,所以使用了和監聽一樣的名稱
EvdedPhone 正在通話的號碼
EvdPhone 要轉出的號碼
EvdGateway 如果是外線號碼,則需要指定網關
```
curl -H "Content-Type: application/json" -d '{"EvdedPhone":"1002","EvdPhone":"1003","EvdGateway":""}' -H "Authorization:Nway token" http://192.168.1.115:8085/api/transfer
```
27 按uuid進行放音
```
參數: Uuid, FilePath, Loopplay, Channel string
Channel both,aleg,bleg
curl -H "Content-Type: application/json" -d '{"PhoneNumber":"1002","FilePath":"D:\nwaytest.wav","Loopplay":"true","Channle":"aleg"}' -H "Authorization:Nway . . " http://192.168.1.115:8085/api/uuid_playback
```
28 按uuid打斷
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/uuid_break/uuid
29 按 uuid 掛斷
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/uuid_hangup/uuid
30 按uuid park
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/uuid_park/uuid
31 按uuid hold
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/uuid_hold/uuid
32 按 uuid answer
curl -H "Authorization:Nway token " http://192.168.1.115:8085/api/uuid_answer/uuid
33 按uuid transfer
```
參數: EvdedUuid, EvdPhone, EvdGateway string
curl -H "Content-Type: application/json" -d '{"EvdedUuid":"uuid","EvdPhone":"1102","EvdGateway ":"nway1"}' -H "Authorization:Nway . . " http://192.168.1.115:8085/api/uuid_transfer
```
這里的會議以3000為主,主被叫號碼1002,1003,1000,1004/
1 //創建一個3000名稱的會議室,主持人號碼是1002,不經過落地網關
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","PhoneNumber":"1002","GatewayName":""}' -H "Authorization:Nway token" http://192.168.1.115:8082/api/conference_create
"/conference_create"
2 //增加一個成員并呼叫
//由系統呼叫號碼為1002的號碼,不經過落地網關,IsMute為默認是禁止發方與否
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","PhoneNumber":"1002","GatewayName":"","IsMute":"false"}' -H "Authorization:Nway token" http://192.168.1.115:8082/api/conference_add
"/conference_add"
3 //獲得一個會議中某號碼的memberid
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","CallerNumber":"1002"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_memberid
"/conference_memberid"
4 //踢掉所有與會成員
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_kick_all/3000
"/conference_kick_all/:conference"
5 //會議自動增益
//param on/off
//level a number
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","param":"on","level":"4"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_agc
"/conference_agc"
6 //檢查錄音狀態
curl -H "Authorization:Nway token. . " http://192.168.1.115:8082/api/conference_chkrecord/3000
"/conference_chkrecord"
7 //禁聽
//memberid是用getmemberid獲得 //Flag |all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_deaf
"/conference_deaf"
8 //發送dtmf到會議成員 //Flag |all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":"", "Dtmf":"520"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_dtmf
"/conference_dtmf"
9 //調整某個會議成員的energy //Flag |all|last|non_moderator //Newval
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":"", "Newval":"520"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_energy
"/conference_energy"
10 //進入會議時的語音 //flag on|off|none|file //Filename Flag為file時有效
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"3","Filename":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_enter_sound
"/conference_enter_sound"
11 //退出會議的語音
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"3","Filename":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_exit_sound
"/conference_exit_sound"
12 // "切換會議人員狀態" //Flag member_id|all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_floor
"/conference_floor"
13 //掛斷某個member,但不播放退出音
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_hup
"/conference_hup"
14 //掛斷某個member,播放退出音
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_kick
"/conference_kick"
15 //列出會議 //Flag [pretty|summary|count|delim ]
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_list/pretty
"/conference_list/:flag"
16 //鎖定某個會議,不允許新的人員進入
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_lock/3000
"/conference_lock/:conference"
17 //解鎖某個會議,允許新的會議人員進入
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_unlock/3000
"/conference_unlock/:conference"
//
18 //禁言 //Flag |all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":"","Quiet":"quiet"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_mute
"/conference_mute"
19 //允許發言 //Flag |all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":"","Quiet":"quiet"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_unmute
"/conference_unmute"
20 //移除當前會議的錄音 //Flag |all
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"all"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_norecord
"/conference_norecord"
21 //會議暫停錄音 //Flag
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"all"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_pause
"/conference_pause"
22 //設置會議呼入時的口令 //Flag
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"all"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_pin
"/conference_pin"
23 //播放相關文件給會議 //Flag [{vol=,full-screen=true,png_ms=100}] [async| [nomux]]
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"all"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_play
"/conference_play"
24 //會議錄音 //Flag
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"all"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_record
"/conference_record"
25 //會議錄音控制
// recording start
// recording check
// recording stop |all
// recording pause
// recording resume
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"start","Filename":"/home/recording/abc.wav"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_recording
"/conference_recording"
26 //恢復會議錄音
//Flag
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Flag":"/home/recording/abc.wav"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_resume
"/conference_resume"
"/conference_say"
27 //設置一些會議參數
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Param":"Value","Filename":"/home/recording/abc.wav"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_set
"/conference_set"
28 //停止播放一些語音 //Flag [current|all] []
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_stop
"/conference_stop"
29 //切換禁言 //Flag |all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":"","Quiet":"quiet"}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_tmute
"/conference_tmute"
30 //解除禁聽 //Flag |all|last|non_moderator
curl -H "Content-Type: application/json" -d '{"ConferenceName":"3000","Member_id":"3","Flag":""}' -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_undeaf
"/conference_undeaf"
//
31 //移除會議口令
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_nopin/3000
"/conference_nopin/:conference"
32 //暫停播放
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_pause_play/3000
"/conference_pause_play/:conference"
33 //查詢所有正在進行中的會議
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conferences
34//查詢某個會議中的成員列表
curl -H "Authorization:Nway token " http://192.168.1.115:8082/api/conference_members/3000
上海老李,QQ:1354608370,FreeSWITCH QQ群:
總結
以上是生活随笔為你收集整理的freeswitch ws php,针对FreeSwitch的呼叫中心接口的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php正则表达式表情,php正则表达式储
- 下一篇: linux 格式化工具 mkfs 简介