Documentation
¶
Index ¶
- Variables
- func CacheChannel(uuid string, channel *FakeChannel)
- type App
- type CallDetailRecord
- type Dialplan
- type FakeChannel
- type OptionFn
- type Options
- type RequestParam
- type TBoy
- func (boy *TBoy) Accept(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Answer(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Bridge(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) ChannelBridge(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Dial(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) DialError(ctx context.Context, msg *ctrl.Message, reply string, code int32)
- func (boy *TBoy) Error(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Event(msg *ctrl.Message, natsEvent nats.Event)
- func (boy *TBoy) GetVar(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Hangup(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Init()
- func (boy *TBoy) NativeAPI(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) NativeAPIStatus(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) NativeJSAPI(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) NativeJSAPIStatus(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) OK(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) ReadDTMF(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Record(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) SetDomain(domain string)
- func (boy *TBoy) SetUUID(uuid string)
- func (boy *TBoy) SetVar(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoy) Stop(ctx context.Context, msg *ctrl.Message, reply string)
- type TBoyACD
- func (boy *TBoyACD) AddChannel(key string, channel *FakeChannel)
- func (boy *TBoyACD) Dial(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoyACD) Event(msg *ctrl.Message, natsEvent nats.Event)
- func (boy *TBoyACD) Play(ctx context.Context, msg *ctrl.Message, reply string)
- func (boy *TBoyACD) Transfer(ctx context.Context, msg *ctrl.Message, reply string)
- type TBoySimple
Constants ¶
This section is empty.
Variables ¶
View Source
var Channels map[string]*FakeChannel
Functions ¶
func CacheChannel ¶
func CacheChannel(uuid string, channel *FakeChannel)
Types ¶
type CallDetailRecord ¶
type CallDetailRecord struct {
UUID string `json:"uuid" validate:"required"` // 话单UUID
Domain string `json:"xcc_domain"` // 域
Mark string `json:"xcc_mark"` // 号码方向
UID string `json:"xcc_uid"` // 用户UID
Context string `json:"context"` // context
Billsec int `json:"billsec,string"` // 通话时长
CallerIDName string `json:"caller_id_name"` // 主叫名称
CallerIDNumber string `json:"caller_id_number"` // 主叫号码
DestinationNumber string `json:"destination_number"` // 被叫号码
OriginCidNumber string `json:"xcc_origin_cid_number"` // 原始主叫号码
OriginDestNumber string `json:"xcc_origin_dest_number"` // 原始被叫号码
OriginOutboundCidNumber string `json:"xcc_origin_outbound_cid_number"` // 原始外显号码
StationType string `json:"xcc_stationtype"` // SIP | PSTN
Direction string `json:"direction"` // 逻辑方向
Duration int `json:"duration,string"` // 花费时长
HangupCause string `json:"hangup_cause"` // 挂机原因
PeerUUID string `json:"peer_uuid"` // 对端UUID
SipToHost string `json:"sip_to_host"` //
SipFromHost string `json:"sip_from_host"` //
SipDisplay string `json:"sip_from_display"` //
SipNetworkAddr string `json:"sip_local_network_addr"` //
SipNetworkPort int `json:"sip_network_port,string"` //
SipHangupDisposition string `json:"sip_hangup_disposition,omitempty"`
SofiaProfileName string `json:"sofia_profile_name"` // default 分机号码, public 外线号码, interconnect 转移
SofiaProfileURL string `json:"sofia_profile_url"` //
StartStamp string `json:"start_stamp"` // 开始时间
AnswerStamp string `json:"answer_stamp"` // 接听时间
EndStamp string `json:"end_stamp"` // 结束时间
Leg string `json:"leg"` //
ServingSide string `json:"cc_side"` //
ServingAgentUUID string `json:"cc_agent"` // 坐席UUID
ServingAgentName string `json:"cc_agent_name"` // 坐席名称
ServingAgentScore int `json:"cc_agent_rating_score,string"` // 评分
ServingAgentSession string `json:"cc_agent_session_uuid"` //
ServingAgentEmployeeNumber string `json:"cc_agent_employee_number"` // 工号
ServingQueueUUID string `json:"cc_queue"` // 队列UUID
ServingQueueName string `json:"cc_queue_name"` // 队列名称
ServingQueueJoinedEpoch int64 `json:"cc_queue_joined_epoch,string"` // 加入队列时间
ServingQueueAnsweredEpoch int64 `json:"cc_queue_answered_epoch,string"` // 坐席应答时间
ServingQueueTerminatedEpoch int64 `json:"cc_queue_terminated_epoch,string"` // 坐席挂机时间
ServingContact string `json:"cc_contact"` //
MemberUUID string `json:"cc_member_uuid"` // 成员UUID
MemberSession string `json:"cc_member_session_uuid"` //
Session string `json:"xcc_session"` // session
}
CallDetailRecord 话单详情
type Dialplan ¶
type Dialplan struct {
UID string `json:"xcc_uid,omitempty"`
UUID string `json:"uuid,omitempty"`
NodeUUID string `json:"node_uuid,omitempty"`
Domain string `json:"xcc_domain,omitempty"`
Context string `json:"context,omitempty"`
FromHost string `json:"sip_from_host,omitempty"`
ToHost string `json:"sip_to_host,omitempty"`
Network string `json:"sip_network,omitempty"`
Date string `json:"date_local,omitempty"`
Direction string `json:"caller_direction,omitempty"`
CallerName string `json:"caller_name,omitempty"`
CallerNumber string `json:"caller_number,omitempty"`
DestinationNumber string `json:"destination_number,omitempty"`
RoutingTag string `json:"xcc_routing_tag,omitempty"`
RouteUuid string `json:"xcc_route_uuid,omitempty"`
RedlistExecChecked string `json:"xcc_redlist_exec_checked,omitempty"` // 判断是否已经执行过红名单
OriginCidNumber string // 内部转发带不过来,需从 session 中取
OriginDestNumber string // 内部转发带不过来,需从 session 中取
Session string `json:"xcc_session,omitempty"`
}
Dialplan .
type FakeChannel ¶
type FakeChannel struct {
CtrlUuid string
PeerUuid string
Lock sync.RWMutex
Data *xctrl.ChannelEvent
Context context.Context
Cancel context.CancelFunc
}
type OptionFn ¶
type OptionFn func(*Options)
func OptionAcdAssign ¶
func OptionActualPlay ¶
func OptionPeerAnswer ¶
func OptionPeerReject ¶
func OptionPeerWait ¶
type RequestParam ¶
type RequestParam struct {
UUID string `json:"uuid"`
NodeIP string `json:"node_ip"`
NodeUUID string `json:"node_uuid"`
CDR *CallDetailRecord `json:"cdr" validate:"required"`
}
RequestParam .
type TBoy ¶
TBoy .
func (*TBoy) ChannelBridge ¶
func (*TBoy) NativeAPIStatus ¶
func (*TBoy) NativeJSAPI ¶
func (*TBoy) NativeJSAPIStatus ¶
type TBoyACD ¶
type TBoyACD struct {
*TBoy
}
func (*TBoyACD) AddChannel ¶
func (boy *TBoyACD) AddChannel(key string, channel *FakeChannel)
type TBoySimple ¶
type TBoySimple struct {
*TBoy
}
func NewSimple ¶
func NewSimple(node_uuid string, domain string, fn ...OptionFn) *TBoySimple
NewTBoy .
func (*TBoySimple) AddChannel ¶
func (boy *TBoySimple) AddChannel(key string, channel *FakeChannel)
func (*TBoySimple) ChannelEvent ¶
func (boy *TBoySimple) ChannelEvent(ctx context.Context, channel *ctrl.Channel)
we don't use this method in node side
Click to show internal directories.
Click to hide internal directories.