codecamp

OpenAI 转接 Live SIP 呼叫

转接呼叫

post /live/sessions/{session_id}/refer

将SIP呼叫转接到另一目标。为SIP Refer-To请求头提供非空白target_uri。

路径参数

  • session_id: string

从创建响应或来电 Webhook 获得的不透明 Live 会话 ID。原样使用返回值,包括前缀。

请求体参数

媒体类型为 application/json。

  • target_uri: string

最短 1 个字符,须匹配 \S,即至少含一个非空白字符。

SIP Refer-To请求头使用的非空白URI,例如tel:+14155550123或sip:agent@example.com。

示例

## [中文] 本节POST请求格式;替换API凭证和出现的会话占位标识,制作本地稿不发起会话、呼叫或其他请求。
curl https://api.openai.com/v1/live/sessions/$SESSION_ID/refer \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -d '{
          "target_uri": "tel:+14155550123"
        }'
OpenAI 挂断 Live 会话
OpenAI 拒绝 Live SIP 呼叫
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

其他能力与进阶指南

Embeddings 接口参考

审计日志接口参考

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }