Skip to content

Commit

Permalink
DEV-4297
Browse files Browse the repository at this point in the history
  • Loading branch information
i.navrotskyj committed Jul 8, 2024
1 parent 43ed22e commit 88df813
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
16 changes: 13 additions & 3 deletions call_manager/call_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func (cm *CallManagerImpl) InboundCallQueue(call *model.Call, ringtone string, v

res := &CallImpl{
callRequest: nil,
direction: model.CALL_DIRECTION_INBOUND, //FIXME
id: call.Id,
api: cli,
cm: cm,
Expand All @@ -190,6 +189,12 @@ func (cm *CallManagerImpl) InboundCallQueue(call *model.Call, ringtone string, v
state: CALL_STATE_ACCEPT, //FIXME
}

if call.Direction == model.CALL_DIRECTION_OUTBOUND {
res.direction = model.CALL_DIRECTION_OUTBOUND
} else {
res.direction = model.CALL_DIRECTION_INBOUND
}

res.info = model.CallActionInfo{
GatewayId: nil,
UserId: nil,
Expand Down Expand Up @@ -243,7 +248,6 @@ func (cm *CallManagerImpl) ConnectCall(call *model.Call, ringtone string) (Call,

res := &CallImpl{
callRequest: nil,
direction: model.CALL_DIRECTION_INBOUND, //FIXME
id: call.Id,
api: cli,
cm: cm,
Expand All @@ -254,10 +258,16 @@ func (cm *CallManagerImpl) ConnectCall(call *model.Call, ringtone string) (Call,
state: CALL_STATE_ACCEPT, //FIXME
}

if call.Direction == model.CALL_DIRECTION_OUTBOUND {
res.direction = model.CALL_DIRECTION_OUTBOUND
} else {
res.direction = model.CALL_DIRECTION_INBOUND
}

res.info = model.CallActionInfo{
GatewayId: nil,
UserId: nil,
Direction: "inbound",
Direction: call.Direction,
Destination: call.Destination,
From: &model.CallEndpoint{
Type: "dest",
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
buf.build/gen/go/grpc-ecosystem/grpc-gateway/protocolbuffers/go v1.34.2-20231027202514-3f42134f4c56.2 // indirect
buf.build/gen/go/webitel/chat/grpc/go v1.4.0-20240703121916-db3266bbfcd3.2 // indirect
buf.build/gen/go/webitel/chat/protocolbuffers/go v1.34.2-20240703121916-db3266bbfcd3.2 // indirect
buf.build/gen/go/webitel/engine/grpc/go v1.4.0-20240618123100-3e740393d1cc.1 // indirect
buf.build/gen/go/webitel/engine/protocolbuffers/go v1.34.2-20240627112700-3fe53516f45c.2 // indirect
buf.build/gen/go/webitel/webitel-go/grpc/go v1.3.0-20240527133231-c12eb2a85c36.3 // indirect
buf.build/gen/go/webitel/webitel-go/protocolbuffers/go v1.34.1-20240527133231-c12eb2a85c36.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion queue/call_inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (queue *InboundQueue) run(attempt *Attempt, mCall call_manager.Call) {
return
}

if agentCall.HangupAt() == 0 {
if agentCall.HangupAt() == 0 && !(mCall.Direction() == model.CallDirectionOutbound && mCall.TransferFrom() != nil) {
if mCall.BridgeAt() > 0 {
agentCall.Hangup(model.CALL_HANGUP_NORMAL_CLEARING, false, nil)
} else {
Expand Down

0 comments on commit 88df813

Please sign in to comment.