Fixes #3247 - CTI-API should handle doubled requests better.
This commit is contained in:
parent
b8b57781b7
commit
b3da6d31ff
2 changed files with 18 additions and 4 deletions
|
@ -41,12 +41,14 @@ class Cti::Driver::Base
|
|||
end
|
||||
|
||||
log = Cti::Log.process(@params)
|
||||
if log.present?
|
||||
|
||||
# push new call notification
|
||||
push_incoming_call(log)
|
||||
# push new call notification
|
||||
push_incoming_call(log)
|
||||
|
||||
# open screen if call got answered
|
||||
push_open_ticket_screen(log)
|
||||
# open screen if call got answered
|
||||
push_open_ticket_screen(log)
|
||||
end
|
||||
|
||||
result || {}
|
||||
end
|
||||
|
|
|
@ -407,6 +407,18 @@ RSpec.describe 'Integration CTI', type: :request do
|
|||
|
||||
travel 1.second
|
||||
|
||||
# inbound - I - answer for hangup by customer
|
||||
post "/api/v1/cti/#{token}", params: {
|
||||
event: 'answer',
|
||||
direction: 'in',
|
||||
call_id: '1234567890-3',
|
||||
to: '4930600000000',
|
||||
from: '4912347114711',
|
||||
}, as: :json
|
||||
expect(response).to have_http_status(:ok)
|
||||
|
||||
travel 1.second
|
||||
|
||||
# inbound - II - new call
|
||||
post "/api/v1/cti/#{token}", params: {
|
||||
event: 'newCall',
|
||||
|
|
Loading…
Reference in a new issue