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
3bb592c9
authored
2019-07-26 18:31:04 +0530
by
Manish Mihsra
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added kqueue table check, removed accesslog
1 parent
903d6aaf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
12 deletions
application/app/Console/Commands/CreateCall.php
application/app/Console/Commands/PredictiveCallHangUp.php
application/app/Http/Middleware/AfterFilter.php
application/app/Http/Middleware/BeforeFilter.php
application/app/Jobs/KPAMIListen.php
application/app/Models/Kqueue.php
application/app/Console/Commands/CreateCall.php
View file @
3bb592c
...
...
@@ -263,7 +263,8 @@ class CreateCall extends Command {
{
for
(
$i
=
0
;
$i
<
$acalls
;
$i
++
)
{
$this
->
useChannelToDial
(
$client
,
$availDialStr
);
$this
->
createCrmCall
(
$client
,
$availDialStr
);
// $this->useChannelToDial($client, $availDialStr);
}
}
}
...
...
@@ -293,7 +294,7 @@ class CreateCall extends Command {
return
;
}
public
function
createCrmCall
(
$client
,
$
dialline
)
public
function
createCrmCall
(
$client
,
$
availDialStr
)
{
//TODO: Need to check whether callerid is required or not (in case of GSM Gateway)
$callerid
=
""
;
...
...
@@ -314,9 +315,10 @@ class CreateCall extends Command {
// DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
}
$dialline
->
user_id
=
$user_id
;
$dialline
=
Dialline
::
where
(
'server'
,
'='
,
env
(
'app_ip'
))
->
where
(
"status"
,
"="
,
"Free"
)
->
where
(
"enabled"
,
"="
,
"1"
)
->
where
(
"dialstr"
,
"="
,
$availDialStr
)
->
orderBy
(
'updated_at'
,
'ASC'
)
->
first
();
$dialline
->
status
=
"AutoCall"
;
$dialline
->
regexstr
=
$
users
[
0
][
"client"
]
;
$dialline
->
regexstr
=
$
client
;
$dialline
->
number
=
$users
[
0
][
"mobile"
];
$dialline
->
save
();
...
...
application/app/Console/Commands/PredictiveCallHangUp.php
View file @
3bb592c
...
...
@@ -57,13 +57,14 @@ class PredictiveCallHangUp extends Command {
public
function
runHangUp
()
{
try
{
$breathingTime
=
5
;
$breathingTime
=
4
;
$avgringsec
=
30
;
$dStatus
=
"InHangUp"
;
$avgringsec
=
Cutoff
::
select
(
DB
::
Raw
(
'avg(avg_ring) as avgringsec'
))
->
first
();
if
(
$avgringsec
)
$avgringsec
=
intval
(
$avgringsec
->
avgringsec
);
$diallines
=
Dialline
::
where
In
(
"status"
,
[
"Auto"
,
"AutoCall"
])
->
where
(
"conf"
,
"="
,
""
)
->
select
(
'call_id'
,
'src_channel'
,
'status'
,
'updated_at'
,
'channel'
,
'server'
)
->
get
();
$diallines
=
Dialline
::
where
(
'server'
,
'='
,
env
(
'app_ip'
))
->
whereIn
(
"status"
,
[
"Auto"
,
"AutoCall"
])
->
where
(
"conf"
,
"="
,
""
)
->
select
(
'id'
,
'call_id'
,
'src_channel'
,
'status'
,
'updated_at'
,
'channel'
,
'server'
)
->
get
();
foreach
(
$diallines
as
$dialline
)
{
...
...
@@ -71,7 +72,10 @@ class PredictiveCallHangUp extends Command {
$lastUpdatedTime
=
strtotime
(
date
(
"Y-m-d H:i:s"
))
-
strtotime
(
$dialline
->
updated_at
);
$callId
=
$dialline
->
call_id
;
if
(
$dialline
->
status
==
'Auto'
&&
$lastUpdatedTime
>
$breathingTime
)
{
if
(
$dialline
->
status
==
'Auto'
&&
$lastUpdatedTime
>
29
)
{
$dialline
->
status
=
$dStatus
;
$dialline
->
save
();
$newqueue
->
hangupChannelS
(
$dialline
->
channel
,
$dialline
->
server
);
$this
->
updateCrmCallEntry
(
$callId
);
...
...
application/app/Http/Middleware/AfterFilter.php
View file @
3bb592c
...
...
@@ -24,7 +24,7 @@ class AfterFilter {
$response
=
$next
(
$request
);
Config
::
get
(
'runtime.accesslog_obj'
)
->
stopLog
();
//
Config::get('runtime.accesslog_obj')->stopLog();
return
$response
;
}
...
...
application/app/Http/Middleware/BeforeFilter.php
View file @
3bb592c
...
...
@@ -33,8 +33,8 @@ class BeforeFilter {
return
redirect
()
->
secure
(
Config
::
get
(
"app.protocol"
)
.
Config
::
get
(
"app.domain"
)
.
$request
->
getRequestUri
());
}
$accesslog
=
new
Accesslog
();
Config
::
set
(
'runtime.accesslog_obj'
,
$accesslog
->
startLog
());
//
$accesslog = new Accesslog();
//
Config::set('runtime.accesslog_obj',$accesslog->startLog());
$grparr
=
array
();
$activegrps
=
Group
::
where
(
'status'
,
'='
,
'Active'
)
->
get
(
array
(
'group'
));
...
...
application/app/Jobs/KPAMIListen.php
View file @
3bb592c
...
...
@@ -1489,7 +1489,6 @@ class KPAMIListen implements IEventListener
foreach
(
$sipids
as
$sipid
)
{
$clientsarr
=
json_decode
(
$sipid
->
clients
,
true
);
if
(
$crmcall
->
client
==
""
)
$first_a
=
$sipid
;
else
...
...
@@ -1527,7 +1526,7 @@ class KPAMIListen implements IEventListener
$userEntry
=
User
::
find
(
$found
->
user
);
if
(
!
empty
(
$userEntry
)){
if
(
$userEntry
->
current_dialmode
!=
"Predictive"
||
$found
->
ready
!=
1
)
return
;
if
(
$userEntry
->
current_dialmode
!=
"Predictive"
||
$found
->
ready
!=
1
||
$dialline
->
regexstr
!=
$userEntry
->
sel_campaign
)
return
;
}
exec
(
"/usr/sbin/asterisk -rx 'core show channel
$dialline->channel
'"
,
$channelArr
);
...
...
application/app/Models/Kqueue.php
View file @
3bb592c
...
...
@@ -6,6 +6,15 @@ class Kqueue extends Model{
protected
$table
=
'kqueues'
;
public
function
__construct
()
{
$tableIp
=
str_replace
(
'.'
,
'-'
,
env
(
"app_ip"
));
$this
->
table
=
'kqueues_'
.
$tableIp
;
return
$this
;
}
//protected $fillable = array('status','data','log','group');
public
function
userToConf
(
$sipid
)
...
...
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