Skip to content

Commit

Permalink
Merge pull request #45 from webitel/v23.09
Browse files Browse the repository at this point in the history
V23.09
  • Loading branch information
navrotskyj authored Nov 27, 2023
2 parents ff8aad2 + c9850c4 commit e7ed8b1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion queue/queue_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func IsHuman(call call_manager.Call, amd *model.QueueAmdSettings) bool {

if amd.Ai {
aiAmd := call.AiResult()
if aiAmd.Error != "" {
if aiAmd.Error != "" || aiAmd.Result == "undefined" {
return true // TODO ?
}
for _, v := range amd.PositiveTags {
Expand Down
9 changes: 7 additions & 2 deletions queue/queue_call_predict.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ retry_:
//"wbt_from_name": attempt.resource.Gateway().Name,
"wbt_from_type": "gateway",

"wbt_to_id": fmt.Sprintf("%d", *attempt.MemberId()),
"wbt_to_name": attempt.Name(),
"wbt_to_type": "member",
"wbt_to_number": attempt.Destination(),
Expand All @@ -150,14 +149,20 @@ retry_:
model.QUEUE_TYPE_NAME_FIELD: queue.TypeName(),

model.QUEUE_SIDE_FIELD: model.QUEUE_SIDE_MEMBER,
model.QUEUE_MEMBER_ID_FIELD: fmt.Sprintf("%v", *attempt.MemberId()),
model.QUEUE_ATTEMPT_ID_FIELD: fmt.Sprintf("%d", attempt.Id()),
model.QUEUE_RESOURCE_ID_FIELD: fmt.Sprintf("%d", attempt.resource.Id()),
},
),
Applications: make([]*model.CallRequestApplication, 0, 2),
}

memberId := attempt.MemberId()
// TODO delete member after reserved
if memberId != nil {
callRequest.Variables[model.QUEUE_MEMBER_ID_FIELD] = fmt.Sprintf("%v", *memberId)
callRequest.Variables["wbt_to_id"] = callRequest.Variables[model.QUEUE_MEMBER_ID_FIELD]
}

attempt.resource.Take() // rps

callRequest.Variables = model.UnionStringMaps(
Expand Down
3 changes: 3 additions & 0 deletions queue/queue_call_progressive.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ func (queue *ProgressiveCallQueue) run(attempt *Attempt, team *agentTeam, agent
wlog.Debug(fmt.Sprintf("attempt[%d] reporting...", attempt.Id()))
team.Reporting(queue, attempt, agent, agentCall.ReportingAt() > 0, agentCall.Transferred())
} else {
if agentCall.HangupAt() == 0 && agentCall.TransferTo() == nil && mCall.HangupAt() > 0 {
agentCall.Hangup(model.CALL_HANGUP_ORIGINATOR_CANCEL, false, nil)
}
//FIXME cancel if progressive cnt > 1
team.Missed(attempt, agent)
queue.queueManager.LeavingMember(attempt)
Expand Down
3 changes: 1 addition & 2 deletions queue/queue_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package queue

import (
"fmt"
"github.com/webitel/call_center/call_manager"
"github.com/webitel/call_center/model"
"github.com/webitel/protos/workflow"
)
Expand Down Expand Up @@ -80,7 +79,7 @@ func (q *BaseQueue) Hook(name string, at *Attempt) {

id, err := q.queueManager.app.FlowManager().Queue().StartFlow(req)

call_manager.DUMP(req.Variables)
//call_manager.DUMP(req.Variables)

if err != nil {
at.Log(fmt.Sprintf("hook \"%s\", error: %s", name, err.Error()))
Expand Down

0 comments on commit e7ed8b1

Please sign in to comment.