
# 会话转移:transfer
#### 场景描述
座席系统可以调用此接口将指定callid的多媒体会话转给其他座席处理。
#### 接口方法
设置成"POST"。该接口仅支持POST方法，不支持PUT、GET和DELTE等方法。
#### 接口URI
https://ip:port/agentgateway/resource/mediacall/{agentid}/transfer
![](https://support.huaweicloud.com/api-ccfs-cec/public_sys-resources/note_3.0-zh-cn.png)
如果CC-Gateway单机部署，IP地址为CC-Gateway服务器地址，port为CC-Gateway服务器的HTTPS端口号，默认值为8043；如果CC-Gateway采用集群模式部署，IP请配置为NSLB地址， Port请配置为默认值8043。
NSLB上的CC-Gateway端口号，请以nslb用户登录任意一个NSLB节点，执行./nslbctl l查询，查询结果中，如下端口表示CC-Gateway通过NSLB面向第三方系统开放的端口。
![](https://support.huaweicloud.com/api-ccfs-cec/figure/zh-cn_image_0000002204207349.png)
SaaS场景下请咨询运维人员获取IP和Port。
表1URI中携带的参数说明 
| 序号 | 参数名     | 数据类型   | 选取原则 | 说明                     |
|:---|:---|:---|:---|:---|
| 1  | agentid | string | True | 座席的工号，取值范围：101～999999。 |
   
#### 日志中的方法名
transfer
#### 请求说明
- 消息头
  表2请求头参数说明 
  | 序号 | 名称           | 参数类型   | 是否必选 | 说明                                                             |
  |:---|:---|:---|:---|:---|
  | 1  | Content-Type | string | True | 消息主体编码方式，缺省值：application/json;charset=UTF-8                    |
  | 2  | Guid         | string | True | 静态鉴权（AUTHMODE = 1）签入接口返回的Guid；动态鉴权（AUTHMODE = 2）轮询事件接口返回的Guid。 |
     
  
- 消息体
  表3消息体参数说明 
  | 序号 | 名称         | 参数类型    | 是否必选  | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  |:---|:---|:---|:---|:---|
  | 1  | callid     | string  | True  | 呼叫标识。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | 2  | caller     | string  | False | 主叫号码。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | 3  | devicetype | int     | True  | 转出的设备类型。 1：技能队列 2：座席 4：系统接入码                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | 4  | mode       | int     | True  | 转出的模式，详细释义见[表4](https://support.huaweicloud.com/api-ccfs-cec/cec_07_0583.html#ZH-CN_TOPIC_0000002481113788__zh-cn_topic_0000002509989685_zh-cn_topic_0125397795_table676019194916)。 当devicetype值为1时取值： 0：释放转 2：成功转 当devicetype值为2时取值： 0：释放转。 2：成功转。 当devicetype值为4时取值： 0：释放转。 2：成功转。 |
  | 5  | address    | string  | True  | 转移地址，即转移设备类型对应的设备ID。最大长度24。 当devicetype为1时，此处为技能队列编号；当devicetype为2时，此处为座席平台工号；当devicetype为4时，此处为系统接入码。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  | 6  | calldata   | string  | False | 携带数据给转接的座席，最大不能超过2048个字节。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | 7  | skillId    | Integer | 可选    | 技能ID。当devicetype为业务代表为2时，设置该字段才有效。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
     
  
 
#### 响应说明
表4消息体参数说明 
| 序号 | 名称      | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|:---|:---|:---|:---|
| 1  | retcode | string | 消息发送结果。 - 0：成功  - 非0：失败   |
| 2  | message | string | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   
#### 触发事件
- 连接失败（AgentEvent_Connect_Fail）
- 座席进入Talking（AgentEvent_Talking）

- 座席挂断呼叫（AgentEvent_Call_Release）
转移模式为成功转时：
- 成功转结果通知（AgentEvent_SuccTransResult）
 
#### 错误结果码
- 106-004
- 106-005
- 106-006
- 106-009
- 106-010
- 106-012
 
#### 报文样例
- 消息头
  ```
  Content-Type:application/json;charset=UTF-8
  Guid：xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.AgentGateway1
  ```
  
- 请求参数
  ```
  {
      "callid": "1552524689-16797284",
      "caller": "88880021",
      "devicetype": 2,
      "mode": 2,
      "address": "205",
      "calldata": "help"
  }
  ```
  
- 响应参数
  ```
  {
      "message": "success",
      "retcode": "0"
  }
  ```
  
 
