Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flexydial_v3
/
fullerton
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c4cfef0f
authored
2020-04-23 16:44:11 +0000
by
Nitesh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Resolved agent calling issue after removing preview mode
1 parent
6ab40541
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
33 deletions
app/Http/Controllers/DialerController.php
app/Http/Controllers/DialerController.php
View file @
c4cfef0
...
...
@@ -226,8 +226,10 @@ class DialerController extends Controller
else
if
(
$kstychCall
[
'callnumber'
]
!=
""
)
$users
=
$wakka
->
getPersons
(
"mobile='"
.
$kstychCall
[
'callnumber'
]
.
"'
$roclientstr
limit 1"
);
else
$users
=
$this
->
getCallSequencing
(
1
,
$client
);
}
$wakka
->
setPersonKey
(
$users
[
0
][
'id'
],
"status"
,
"Incall"
);
$searchresult
=
'<div style="clear:both"></div><div id=divworking></div><div style="clear:both"></div>'
;
$wakka
->
setPersonKey
(
$users
[
0
][
'id'
],
"status"
,
"Incall"
);
// $searchresult = '<div style="clear:both"></div><div id=divworking></div><div style="clear:both"></div>';
$searchresult
=
"<div style='clear:both'></div><div id=divworking></div><div style='clear:both'></div><script>showRecruit(
\"
"
.
$users
[
0
][
'id'
]
.
"
\"
,
\"
"
.
$enable
.
"
\"
);</script>"
;
if
(
!
empty
(
$users
))
{
if
(
sizeof
(
$users
)
>=
1
)
{
$users
[
0
][
'peopledata'
]
=
preg_replace_callback
(
'!s:(\d+):"(.*?)";!'
,
function
(
$m
)
{
...
...
@@ -272,7 +274,7 @@ class DialerController extends Controller
$userstatus
=
true
;
break
;
}
sleep
(
5
);
sleep
(
1
5
);
}
break
;
}
...
...
@@ -349,7 +351,8 @@ class DialerController extends Controller
// $newqueue = new Kqueue();
// $newqueue->custToMagentConf($sipid, $crmcall, $callerid, $dialline);
// }
$searchresult
.=
"<script>kSetDData('C','callid','"
.
$crmcall
->
id
.
"');kSetDData('C','crmid','"
.
$users
[
0
][
'id'
]
.
"');kSetDData('C','callnumber','
$callnumber
');showRecruit(
\"
"
.
$users
[
0
][
'id'
]
.
"
\"
,
\"
"
.
$enable
.
"
\"
);</script>"
;
$sipid
=
$sipid
->
toArray
();
$searchresult
.=
"<script>kSetDData('C','callid','"
.
$crmcall
->
id
.
"');kSetDData('C','crmid','"
.
$users
[
0
][
'id'
]
.
"');kSetDData('C','callnumber','
$callnumber
');</script>"
;
...
...
@@ -357,7 +360,8 @@ class DialerController extends Controller
doAjax('record?action=quicksearch','maintextsearch_1_txt="
.
$users
[
0
][
'clientinternalid'
]
.
"&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){
if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html('');
});
doAjax('dialer?action=dialcall&sipid="
.
$sipid
->
id
.
"-"
.
$sipid
->
server
.
"&callnumber="
.
$callnumber
.
"&callerid="
.
$callerid
.
"&crmcall="
.
$crmcall
->
id
.
"&dialline="
.
$dialline
->
dialstr
.
"','','', 'ajax_manualdial','singlefail','POST');
doAjax('dialer?action=dialcall&sipid="
.
urlencode
(
json_encode
(
$sipid
))
.
"&callnumber="
.
$callnumber
.
"&callerid="
.
urlencode
(
json_encode
(
$callerid
))
.
"&crmcall="
.
urlencode
(
json_encode
(
$crmcall
))
.
"&sipid1="
.
urlencode
(
json_encode
(
$sipid
))
.
"&dialline="
.
urlencode
(
json_encode
(
$dialline
))
.
"','','', 'ajax_manualdial','singlefail','POST');
</script>"
;
...
...
@@ -378,20 +382,34 @@ class DialerController extends Controller
}
}
else
return
Response
::
make
(
$searchresult
.=
"<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"
);
}
if
(
$action
==
"dialcall"
)
{
$sipid
=
Input
::
get
(
"sipid"
);
$callnumber
=
Input
::
get
(
"callnumber"
);
$callerid
=
(
object
)
Input
::
get
(
"callerid"
);
$crmcall
[]
=
Input
::
get
(
"crmcall"
);
$dialline
[]
=
Input
::
get
(
"dialline"
);
$sipid
=
explode
(
"-"
,
$sipid
);
$sipid_key
=
[
'id'
,
'server'
];
$crmcall_key
=
[
'id'
];
$dialline_key
=
[
'dialstr'
];
$sipid
=
(
object
)
array_combine
(
$sipid_key
,
$sipid
);
$crmcall
=
(
object
)
array_combine
(
$crmcall_key
,
$crmcall
);
$dialline
=
(
object
)
array_combine
(
$dialline_key
,
$dialline
);
if
(
Auth
::
user
()
->
sessiontype
==
'0'
)
{
if
(
$action
==
"dialcall"
)
{
//echo(urldecode(Input::get("sipid1")));
//$t = explode("||",Input::get("sipid1"));
//$t0 = $t[0];
// substr($string, 0, -1);
//echo (trim(html_entity_decode($t0),'"'));
//dd(html_entity_decode(Input::get("sipid1")));
$sipid
=
json_decode
(
html_entity_decode
(
Input
::
get
(
"sipid"
)));
$callnumber
=
json_decode
(
html_entity_decode
(
Input
::
get
(
"callnumber"
)));
$callerid
=
json_decode
(
html_entity_decode
(
Input
::
get
(
"callerid"
)));
$crmcall
=
json_decode
(
html_entity_decode
(
Input
::
get
(
"crmcall"
)));
$dialline
=
json_decode
(
html_entity_decode
(
Input
::
get
(
"dialline"
)));
//dd($sipid,$callnumber,$callerid,$crmcall,$dialline);
//dd(Input::get("sipid1"));
// $sipid = Input::get("sipid");
// $callnumber = Input::get("callnumber");
// $callerid = (object) Input::get("callerid");
// $crmcall = Input::get("crmcall");
// $dialline= Input::get("dialline");
// $sipid = explode("-", $sipid);
// $sipid_key = ['id', 'server'];
// $crmcall_key = ['id'];
// $dialline_key = ['dialstr'];
// $sipid = (object) array_combine($sipid_key, $sipid);
// $crmcall = (object) array_combine($crmcall_key, $crmcall);
// $dialline = (object) array_combine($dialline_key, $dialline);
if
(
Auth
::
user
()
->
sessiontype
==
'0'
)
{
$newqueue
=
new
Kqueue
();
$newqueue
->
userToConf
(
$sipid
);
$newqueue
=
new
Kqueue
();
...
...
@@ -520,11 +538,11 @@ class DialerController extends Controller
$crmcall
->
hsource
=
$hsource
;
$crmcall
->
save
();
}
if
(
Auth
::
user
()
->
sessiontype
==
'0'
)
{
if
(
Auth
::
user
()
->
sessiontype
==
'0'
)
{
$sipid
=
Sipid
::
find
(
$kstychDialer
[
'phone'
]);
}
else
{
}
else
{
$sipid
=
AgentNumber
::
find
(
$crmcall
->
sipid_id
);
if
(
$sipid
&&
$sipid
->
channel
!=
''
)
{
if
(
$sipid
&&
$sipid
->
channel
!=
''
)
{
$newqueue
=
new
Kqueue
();
$newqueue
->
hangupChannelS
(
$sipid
->
channel
,
$sipid
->
server
);
}
...
...
@@ -823,17 +841,17 @@ class DialerController extends Controller
$nowts
=
microtime
(
true
)
*
1000
;
$sipstatus
=
false
;
if
(
\Auth
::
user
()
->
sessiontype
==
'0'
){
$sipid
=
Sipid
::
find
(
$kstychDialer
[
'phone'
]);
if
(
$sipid
&&
$sipid
->
user
==
\Auth
::
user
()
->
id
&&
$sipid
->
status
==
1
)
{
$sipstatus
=
true
;
if
(
\Auth
::
user
()
->
sessiontype
==
'0'
)
{
$sipid
=
Sipid
::
find
(
$kstychDialer
[
'phone'
]);
if
(
$sipid
&&
$sipid
->
user
==
\Auth
::
user
()
->
id
&&
$sipid
->
status
==
1
)
{
$sipstatus
=
true
;
}
}
else
{
$sipid
=
AgentNumber
::
where
(
'user_id'
,
\Auth
::
user
()
->
id
)
->
where
(
'status'
,
'2'
)
->
first
();
if
(
$sipid
)
$sipstatus
=
true
;
}
}
else
{
$sipid
=
AgentNumber
::
where
(
'user_id'
,
\Auth
::
user
()
->
id
)
->
where
(
'status'
,
'2'
)
->
first
();
if
(
$sipid
)
$sipstatus
=
true
;
}
if
(
$sipstatus
){
if
(
$sipstatus
)
{
$sipid
->
ready
=
$ready
;
$sipid
->
prepare_call
=
$perpareCall
;
$sipid
->
save
();
...
...
@@ -1360,7 +1378,7 @@ class DialerController extends Controller
if
(
$limit
>
0
)
{
$tusers
=
$wakka
->
getPersons
(
"status
='New'
and mobile!='' and
$roclientstr
order by dialer_lastcall asc limit
$limit
"
);
$tusers
=
$wakka
->
getPersons
(
"status
In ('called','Incall')
and mobile!='' and
$roclientstr
order by dialer_lastcall asc limit
$limit
"
);
foreach
(
$tusers
as
$tuser
)
if
(
!
isset
(
$users
[
$tuser
[
'id'
]]))
$users
[
$tuser
[
'id'
]]
=
$tuser
;
$limit
=
$limit
-
sizeof
(
$tusers
);
}
...
...
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