Commit 1e20ff83 by usual2970

添加取消通话接口

parent ccae4c34
......@@ -32,7 +32,7 @@ func (c *TelController) Dial() {
if err!=nil{
rs.ErrNo="2"
rs.Msg="拨打失败"
break;
break
}
rs.Data=resp
......@@ -42,3 +42,29 @@ func (c *TelController) Dial() {
c.Data["json"] = rs
c.ServeJSON()
}
func (c *TelController) Cancel(){
rs:=&models.Result{"0","success",nil}
for{
from,to:="",""
sessionId:=c.GetString("sessionId")
if sessionId==""{
rs.ErrNo="1"
rs.Msg="请提交会话ID"
break
}
telObj:=tel.NewTel(from,to)
resp,err:=telObj.Cancel(sessionId)
if err!=nil{
rs.ErrNo="2"
rs.Msg="取消失败"
break
}
rs.Data=resp
break
}
c.Data["json"] = rs
c.ServeJSON()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment