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
0fa8f57b
authored
2019-07-26 16:02:26 +0000
by
Manish Mihsra
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Created new function to connect calls and modify some small changes
1 parent
3bb592c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
application/app/Jobs/KPAMIListen.php
application/app/Jobs/KPAMIListen.php
View file @
0fa8f57
...
...
@@ -1473,7 +1473,6 @@ class KPAMIListen implements IEventListener
if
(
$crmcall
)
{
$nowts
=
microtime
(
true
)
*
1000
;
$crmcalldata
=
json_decode
(
$crmcall
->
data
,
true
);
if
(
!
isset
(
$crmcalldata
[
"userbusyfile"
]))
$crmcalldata
[
"userbusyfile"
]
=
0
;
...
...
@@ -1485,29 +1484,20 @@ class KPAMIListen implements IEventListener
{
echo
"sipids found "
;
$first_r
=
0
;
$first_w
=
0
;
$first_a
=
0
;
$allsipids
=
array
();
foreach
(
$sipids
as
$sipid
)
{
$clientsarr
=
json_decode
(
$sipid
->
clients
,
true
);
if
(
$crmcall
->
client
==
""
)
$first_a
=
$sipid
;
else
{
if
(
$clientsarr
[
'a'
]
!=
""
)
$clientaarr
=
explode
(
","
,
$clientsarr
[
'a'
]);
if
(
isset
(
$clientsarr
[
'a'
])
&&
in_array
(
$crmcall
->
client
,
$clientaarr
))
$first_a
=
$sipid
;
if
(
$clientsarr
[
'w'
]
!=
""
)
$clientwarr
=
explode
(
","
,
$clientsarr
[
'w'
]);
if
(
isset
(
$clientsarr
[
'w'
])
&&
in_array
(
$crmcall
->
client
,
$clientwarr
))
$first_w
=
$sipid
;
if
(
$clientsarr
[
'r'
]
!=
""
)
$clientrarr
=
explode
(
","
,
$clientsarr
[
'r'
]);
if
(
isset
(
$clientsarr
[
'r'
])
&&
in_array
(
$crmcall
->
client
,
$clientrarr
))
$first_r
=
$sipid
;
$this
->
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
);
}
}
}
}
}
}
echo
"Notifying Total ::"
.
sizeof
(
$allsipids
)
.
"
\n
"
;
$found
=
false
;
if
(
$first_a
)
$found
=
$first_a
;
else
if
(
$first_w
)
$found
=
$first_w
;
else
if
(
$first_r
)
$found
=
$first_r
;
private
function
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
)
{
$nowts
=
microtime
(
true
)
*
1000
;
$found
=
$sipid
;
if
(
$found
)
{
...
...
@@ -1526,7 +1516,7 @@ class KPAMIListen implements IEventListener
$userEntry
=
User
::
find
(
$found
->
user
);
if
(
!
empty
(
$userEntry
)){
if
(
$userEntry
->
current_dialmode
!=
"Predictive"
||
$found
->
ready
!=
1
||
$dialline
->
regexstr
!=
$userEntry
->
sel_campaign
)
return
;
if
(
$userEntry
->
current_dialmode
!=
"Predictive"
||
$found
->
ready
!=
1
)
return
;
}
exec
(
"/usr/sbin/asterisk -rx 'core show channel
$dialline->channel
'"
,
$channelArr
);
...
...
@@ -1601,11 +1591,8 @@ class KPAMIListen implements IEventListener
$newqueue
=
new
Kqueue
();
$newqueue
->
sipNotify
(
$found
,
"incomingCall"
,
$crmcall
->
id
,
$crmcall
->
crm_id
,
$crmcall
->
number
.
"@"
.
$dialline
->
channel
);
}
}
}
}
}
}
}
// private function redirectIncoming()
// {
...
...
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