Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flexydial
/
hdfc-beu-v2
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
08d92f35
authored
2019-07-27 14:57:07 +0000
by
Manish Mihsra
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Made some correction in connecteing the call
1 parent
c4d3920b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
application/app/Jobs/KPAMIListen.php
application/app/Jobs/KPAMIListen.php
View file @
08d92f3
...
...
@@ -1465,6 +1465,7 @@ class KPAMIListen implements IEventListener
{
//TODO: Need to create static values for modes
$status
=
array
(
'Auto'
,
'Inbound'
);
//NOTE: Be Careful before changing indexes
$mode
=
""
;
$diallines
=
Dialline
::
where
(
'server'
,
'='
,
$this
->
sipip
)
->
whereIn
(
"status"
,
$status
)
->
where
(
"conf"
,
"="
,
""
)
->
get
();
if
(
$diallines
)
...
...
@@ -1482,12 +1483,29 @@ class KPAMIListen implements IEventListener
$sipids
=
array
();
$sipids
=
Sipid
::
where
(
'server'
,
'='
,
$this
->
sipip
)
->
where
(
"status"
,
"="
,
"1"
)
->
where
(
"ready"
,
"="
,
"1"
)
if
(
$dialline
->
status
==
$status
[
0
])
->
where
(
"prepare_call"
,
"="
,
"1"
)
->
orderBy
(
"updated_at"
,
"desc"
)
->
get
();
if
(
$dialline
->
status
==
$status
[
0
])
{
$mode
=
"Predictive"
;
$sipids
=
Sipid
::
where
(
'server'
,
'='
,
$this
->
sipip
)
->
where
(
"status"
,
"="
,
"1"
)
->
where
(
"ready"
,
"="
,
"1"
)
->
where
(
"prepare_call"
,
"="
,
"1"
)
->
orderBy
(
"updated_at"
,
"desc"
)
->
get
();
}
else
if
(
$dialline
->
status
==
$status
[
1
])
{
$mode
=
"Incoming"
;
$sipids
=
Sipid
::
where
(
'server'
,
'='
,
$this
->
sipip
)
->
where
(
"status"
,
"="
,
"1"
)
->
where
(
"ready"
,
"="
,
"1"
)
->
where
(
"prepare_call"
,
"="
,
"1"
)
->
orderBy
(
"updated_at"
,
"desc"
)
->
get
();
}
if
(
!
empty
(
$sipids
))
{
...
...
@@ -1498,10 +1516,10 @@ class KPAMIListen implements IEventListener
$userEntry
=
User
::
find
(
$sipid
->
user
);
if
(
!
empty
(
$userEntry
)){
if
(
!
array_search
(
$userEntry
->
current_dialmode
,
$status
)
||
$sipid
->
ready
!=
1
)
return
;
if
(
$userEntry
->
current_dialmode
!=
$mode
||
$sipid
->
ready
!=
1
)
return
;
}
$this
->
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
);
$this
->
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
,
$mode
);
}
}
}
...
...
@@ -1541,7 +1559,7 @@ class KPAMIListen implements IEventListener
}
}
private
function
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
)
private
function
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
,
$mode
)
{
$nowts
=
microtime
(
true
)
*
1000
;
...
...
@@ -1595,7 +1613,7 @@ class KPAMIListen implements IEventListener
$dialline
->
save
();
$sipid
->
ready
=
0
;
if
(
$
dialline
->
status
==
$status
[
0
]
)
$sipid
->
prepare_call
=
0
;
if
(
$
mode
==
"Predictive"
)
$sipid
->
prepare_call
=
0
;
$sipid
->
patched
=
1
;
$sipid
->
save
();
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment