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
19eb3f96
authored
2019-07-30 22:00:09 +0530
by
Manish Mihsra
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added check for user availabe in the campaign and then taking sipid value
1 parent
00ecc086
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
51 deletions
application/app/Console/Commands/PredictiveCallHangUp.php
application/app/Jobs/KPAMIListen.php
application/app/Console/Commands/PredictiveCallHangUp.php
View file @
19eb3f9
...
...
@@ -80,7 +80,7 @@ class PredictiveCallHangUp extends Command {
$this
->
updateCrmCallEntry
(
$callId
);
}
elseif
(
$dialline
->
status
==
'AutoCall'
&&
$lastUpdatedTime
>
(
$avgringsec
+
$breathingTime
))
{
elseif
(
$dialline
->
status
==
'AutoCall'
&&
$lastUpdatedTime
>
(
$avgringsec
+
$breathingTime
)
&&
$dialline
->
src_channel
!=
""
)
{
$newqueue
->
hangupChannelS
(
$dialline
->
src_channel
,
$dialline
->
server
);
$this
->
updateCrmCallEntry
(
$callId
);
...
...
application/app/Jobs/KPAMIListen.php
View file @
19eb3f9
...
...
@@ -1481,27 +1481,30 @@ class KPAMIListen implements IEventListener
$crmcalldata
=
json_decode
(
$crmcall
->
data
,
true
);
if
(
!
isset
(
$crmcalldata
[
"userbusyfile"
]))
$crmcalldata
[
"userbusyfile"
]
=
0
;
if
(
$dialline
->
status
==
$status
[
1
])
$this
->
checkMobileNumberExist
(
$crmcall
);
$sipids
=
array
();
$sipid
=
array
();
if
(
$dialline
->
status
==
$status
[
0
])
{
$mode
=
"Predictive"
;
$campaignUserIds
=
User
::
where
(
'sel_campaign'
,
'='
,
$dialline
->
regexstr
)
->
select
(
'id'
)
->
get
()
->
toArray
();
$sipid
=
Sipid
::
where
(
'server'
,
'='
,
$this
->
sipip
)
->
whereIn
(
"user"
,
$campaignUserIds
)
->
where
(
"status"
,
"="
,
"1"
)
->
where
(
"ready"
,
"="
,
"1"
)
->
where
(
"prepare_call"
,
"="
,
"1"
)
->
orderBy
(
"updated_at"
,
"asc"
)
->
first
();
}
else
if
(
$dialline
->
status
==
$status
[
1
])
{
$mode
=
"Incoming"
;
$this
->
checkMobileNumberExist
(
$crmcall
);
$sipid
=
Sipid
::
where
(
'server'
,
'='
,
$this
->
sipip
)
->
where
(
"user"
,
"!="
,
"0"
)
->
where
(
"status"
,
"="
,
"1"
)
->
where
(
"ready"
,
"="
,
"1"
)
->
orderBy
(
"updated_at"
,
"ssc"
)
...
...
@@ -1512,12 +1515,6 @@ class KPAMIListen implements IEventListener
{
echo
"sipids found "
;
$userEntry
=
User
::
find
(
$sipid
->
user
);
if
(
!
empty
(
$userEntry
)){
if
(
$userEntry
->
current_dialmode
!=
$mode
||
$sipid
->
ready
!=
1
)
continue
;
}
$this
->
connectToAvailableSip
(
$sipid
,
$dialline
,
$crmcall
,
$mode
);
}
}
...
...
@@ -1592,59 +1589,58 @@ class KPAMIListen implements IEventListener
$dialline
->
channel
=
""
;
$dialline
->
regexstr
=
""
;
$dialline
->
save
();
return
;
}
$recfile
=
$crmcall
->
newRecFilePath
();
}
else
{
$recfile
=
$crmcall
->
newRecFilePath
();
//start recording
$newqueue
=
new
Kqueue
();
$newqueue
->
recordChannel
(
$dialline
->
server
,
$dialline
->
channel
,
$recfile
);
$newqueue
=
new
Kqueue
();
$newqueue
->
recordChannel
(
$dialline
->
server
,
$dialline
->
channel
,
$recfile
);
$newqueue
=
new
Kqueue
();
$newqueue
->
userToConf
(
$sipid
);
$newqueue
=
new
Kqueue
();
$newqueue
->
userToConf
(
$sipid
);
$newqueue
=
new
Kqueue
();
$newqueue
->
channelRedirectToExten
(
$sipid
->
server
,
$dialline
->
channel
,
"1000"
.
$sipid
->
id
,
"kstychDialer"
,
"1"
);
$newqueue
=
new
Kqueue
();
$newqueue
->
channelRedirectToExten
(
$sipid
->
server
,
$dialline
->
channel
,
"1000"
.
$sipid
->
id
,
"kstychDialer"
,
"1"
);
$dialline
->
user_id
=
$sipid
->
user
;
$dialline
->
conf
=
"1000"
.
$sipid
->
id
;
$dialline
->
save
();
$dialline
->
user_id
=
$sipid
->
user
;
$dialline
->
conf
=
"1000"
.
$sipid
->
id
;
$dialline
->
save
();
$sipid
->
ready
=
0
;
if
(
$mode
==
"Predictive"
)
$sipid
->
prepare_call
=
0
;
$sipid
->
patched
=
1
;
$sipid
->
save
();
$sipid
->
ready
=
0
;
if
(
$mode
==
"Predictive"
)
$sipid
->
prepare_call
=
0
;
$sipid
->
patched
=
1
;
$sipid
->
save
();
$userlog
=
UserLog
::
where
(
'user_id'
,
'='
,
$sipid
->
user
)
->
orderBy
(
"id"
,
"DESC"
)
->
first
();
$ts_Wait
=
$userlog
->
getLastTs
(
$sipid
->
id
,
$nowts
);
$userlog
->
save
();
$userlog
=
UserLog
::
where
(
'user_id'
,
'='
,
$sipid
->
user
)
->
orderBy
(
"id"
,
"DESC"
)
->
first
();
$ts_Wait
=
$userlog
->
getLastTs
(
$sipid
->
id
,
$nowts
);
$userlog
->
save
();
$crmcall
->
user_id
=
$sipid
->
user
;
$crmcall
->
sipid_id
=
$sipid
->
id
;
$crmcall
->
user_id
=
$sipid
->
user
;
$crmcall
->
sipid_id
=
$sipid
->
id
;
if
(
$ts_Wait
<=
$crmcall
->
ts_Wait
)
//user waiting
{
$crmcall
->
ts_Wait
=
$ts_Wait
;
$crmcall
->
setTs
(
'ts_Talk'
,
$nowts
);
}
else
//call waiting
{
$crmcall
->
ts_Wait
-=
(
$nowts
-
$ts_Wait
);
$crmcall
->
setTs
(
'ts_Talk'
,
$nowts
);
}
if
(
$ts_Wait
<=
$crmcall
->
ts_Wait
)
//user waiting
{
$crmcall
->
ts_Wait
=
$ts_Wait
;
$crmcall
->
setTs
(
'ts_Talk'
,
$nowts
);
}
else
//call waiting
{
$crmcall
->
ts_Wait
-=
(
$nowts
-
$ts_Wait
);
$crmcall
->
setTs
(
'ts_Talk'
,
$nowts
);
}
$crmcall
->
setTs
(
'ts_Recstart'
,
$nowts
);
$crmcall
->
save
();
$crmcall
->
setTs
(
'ts_Recstart'
,
$nowts
);
$crmcall
->
save
();
$newqueue
=
new
Kqueue
();
$newqueue
->
sipNotify
(
$sipid
,
"incomingCall"
,
$crmcall
->
id
,
$crmcall
->
crm_id
,
$crmcall
->
number
.
"@"
.
$dialline
->
channel
);
$newqueue
=
new
Kqueue
();
$newqueue
->
sipNotify
(
$sipid
,
"incomingCall"
,
$crmcall
->
id
,
$crmcall
->
crm_id
,
$crmcall
->
number
.
"@"
.
$dialline
->
channel
);
if
(
$crmcall
->
crm_id
>
0
){
DB
::
table
(
'records'
)
->
where
(
'id'
,
$crmcall
->
crm_id
)
->
update
([
'filter_condition'
=>
'3'
,
'usr_id'
=>
$sipid
->
user
]);
if
(
$crmcall
->
crm_id
>
0
){
DB
::
table
(
'records'
)
->
where
(
'id'
,
$crmcall
->
crm_id
)
->
update
([
'filter_condition'
=>
'3'
,
'usr_id'
=>
$sipid
->
user
]);
}
}
}
}
...
...
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