小号系统搭建接口教程

介绍
http bridge 的原理是cti模块实现了一个cti_bridge的FreeSWITCH APP,可以在呼出之前调用HTTP接口获取呼出参数,可用于实现小号业务,有关系统方面问题请找博主,看他名字就可以微他一起交流学习。隐私号业务等外呼之前动态绑定主叫和被叫号码,也可用于呼入业务由HTTP接口控制呼入转接规则。

配置

第一个参数 请求的URL,URL和参数可自定义
第二个参数 connect_timeout 连接超时 单位毫秒,默认3000
第三个参数 response_timeout 等待http接口响应的超时 单位毫秒 默认 3000
第四个参数 notify_type 0:不要呼叫进度通知 1:需要呼叫进度通知,默认1
接口说明
接收到一个呼入后,cti_bridge会把呼叫信息送给接口,接口返回转接信息。以下是返回信息说明

通用用参数说明
variables 可用于设置通道变量,比如主叫号码(origination_caller_id_number),编码(absolute_codec_string)等
number 转接号码(被叫号码)

通过网关呼出 gateway网关名,number被叫号码
{
“variables”: {
“origination_caller_id_number”: “123”,
“absolute_codec_string”: “PCMA,PCMU”
},
“dial”: {
“type”: “gateway”,
“number”: “123456”,
“gateway”: “gw”
}
}
通过注册分机呼出,一般用于注册方式对接到fs,user注册的分机号
{
“dial”: {
“type”: “user”,
“number”: “123456”,
“user”: “1000”
}
}
通过IP直接呼出,ip中继|VOS|网关的IP:PORT
{
“dial”: {
“type”: “ip”,
“number”: “123456”,
“ip”: “网关IP”,
“sofia”: “external”
}
}
通过自定义拨号串呼出,
{
“dial”: {
“type”: “dialstring”,
“dialstring”: “sofia/external/158@ip:port”
}
}
顺序转接给多个号码,第一个号码呼叫失败,继续转接给第二个号码
{
“dial”: {
“type”: “dialstring”,
“dialstring”: “{ignore_early_media=true}sofia/gateway/网关1/号码1,sofia/gateway/网关2/号码2”
}
}
不转接,直接挂断
{
“dial”: {
“type”: “hangup”,
“cause”: 16,
“sipcode”: 500
}
}
cause和sipcode只需要配置一个,sipcode就是SIP代码·cause 取值说明:
typedef enum {
SWITCH_CAUSE_NONE = 0,
SWITCH_CAUSE_UNALLOCATED_NUMBER = 1,
SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET = 2,
SWITCH_CAUSE_NO_ROUTE_DESTINATION = 3,
SWITCH_CAUSE_CHANNEL_UNACCEPTABLE = 6,
SWITCH_CAUSE_CALL_AWARDED_DELIVERED = 7,
SWITCH_CAUSE_NORMAL_CLEARING = 16,
SWITCH_CAUSE_USER_BUSY = 17,
SWITCH_CAUSE_NO_USER_RESPONSE = 18,
SWITCH_CAUSE_NO_ANSWER = 19,
SWITCH_CAUSE_SUBSCRIBER_ABSENT = 20,
SWITCH_CAUSE_CALL_REJECTED = 21,
SWITCH_CAUSE_NUMBER_CHANGED = 22,
SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION = 23,
SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR = 25,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER = 27,
SWITCH_CAUSE_INVALID_NUMBER_FORMAT = 28,
SWITCH_CAUSE_FACILITY_REJECTED = 29,
SWITCH_CAUSE_RESPONSE_TO_STATUS_ENQUIRY = 30,
SWITCH_CAUSE_NORMAL_UNSPECIFIED = 31,
SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION = 34,
SWITCH_CAUSE_NETWORK_OUT_OF_ORDER = 38,
SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE = 41,
SWITCH_CAUSE_SWITCH_CONGESTION = 42,
SWITCH_CAUSE_ACCESS_INFO_DISCARDED = 43,
SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL = 44,
SWITCH_CAUSE_PRE_EMPTED = 45,
SWITCH_CAUSE_FACILITY_NOT_SUBSCRIBED = 50,
SWITCH_CAUSE_OUTGOING_CALL_BARRED = 52,
SWITCH_CAUSE_INCOMING_CALL_BARRED = 54,
SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH = 57,
SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL = 58,
SWITCH_CAUSE_SERVICE_UNAVAILABLE = 63,
SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL = 65,
SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED = 66,
SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED = 69,
SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED = 79,
SWITCH_CAUSE_INVALID_CALL_REFERENCE = 81,
SWITCH_CAUSE_INCOMPATIBLE_DESTINATION = 88,
SWITCH_CAUSE_INVALID_MSG_UNSPECIFIED = 95,
SWITCH_CAUSE_MANDATORY_IE_MISSING = 96,
SWITCH_CAUSE_MESSAGE_TYPE_NONEXIST = 97,
SWITCH_CAUSE_WRONG_MESSAGE = 98,
SWITCH_CAUSE_IE_NONEXIST = 99,
SWITCH_CAUSE_INVALID_IE_CONTENTS = 100,
SWITCH_CAUSE_WRONG_CALL_STATE = 101,
SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE = 102,
SWITCH_CAUSE_MANDATORY_IE_LENGTH_ERROR = 103,
SWITCH_CAUSE_PROTOCOL_ERROR = 111,
SWITCH_CAUSE_INTERWORKING = 127,
SWITCH_CAUSE_SUCCESS = 142,
SWITCH_CAUSE_ORIGINATOR_CANCEL = 487,
SWITCH_CAUSE_CRASH = 500,
SWITCH_CAUSE_SYSTEM_SHUTDOWN = 501,
SWITCH_CAUSE_LOSE_RACE = 502,
SWITCH_CAUSE_MANAGER_REQUEST = 503,
SWITCH_CAUSE_BLIND_TRANSFER = 600,
SWITCH_CAUSE_ATTENDED_TRANSFER = 601,
SWITCH_CAUSE_ALLOTTED_TIMEOUT = 602,
SWITCH_CAUSE_USER_CHALLENGE = 603,
SWITCH_CAUSE_MEDIA_TIMEOUT = 604,
SWITCH_CAUSE_PICKED_OFF = 605,
SWITCH_CAUSE_USER_NOT_REGISTERED = 606,
SWITCH_CAUSE_PROGRESS_TIMEOUT = 607,
SWITCH_CAUSE_INVALID_GATEWAY = 608,
SWITCH_CAUSE_GATEWAY_DOWN = 609,
SWITCH_CAUSE_INVALID_URL = 610,
SWITCH_CAUSE_INVALID_PROFILE = 611,
SWITCH_CAUSE_NO_PICKUP = 612,
SWITCH_CAUSE_SRTP_READ_ERROR = 613
} switch_call_cause_t;
进度通知
http://url&action=request&uuid=xxxx

URL 就是cti_bridge配置的URL

action

request 请求转接参数
hangup 通话挂断
ring 收到180
progress 收到183
answer 通话应答
uuid 通话UUID

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI_wx_3307623172

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值