Vicidial asterisk with php

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Vicidial asterisk with php

Postby bbakirtas » Thu Dec 05, 2019 10:22 am

hi
i'm try to making new report for vicidial.
my purpose showing agents sip peers (asterisk -rx "sip show peers") my report will show agents connections ping values.
but i couldn't run with php asterisk command. Can i make with agi? or what is yours suggestions.
Thanks

VERSION: 2.14-730a
BUILD: 191121-2256
Vicibox 9.0.1
VERSION: 2.14-738a
BUILD: 200210-1628
Intel Xeon X5650 12 Core HT 24 Core 2.90 Ghz
64 GB ECC Registered Memory
bbakirtas
 
Posts: 93
Joined: Thu Dec 06, 2012 3:35 am
Location: Turkey

Re: Vicidial asterisk with php

Postby williamconley » Thu Dec 05, 2019 10:35 am

1) This is not a "General Discussion". It's a Support request. I will move the thread to the Support board.

2) Apache (which initiates php to generate html web pages) does not have permission to run command line programs as root. Adding the ability for apache/php to run the command "asterisk" as root is not a simple task, but can be done.

3) It might be simpler to run a crontab script that runs your command and stores the result in a txt or html page which you can then merely access with a web browser. If you run it every 10 minutes and store it in a web accessible folder the only thing you lose is the ability to generate it on demand.

Happy Hunting! 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Vicidial asterisk with php

Postby ambiorixg12 » Thu Dec 05, 2019 1:19 pm

You wont be able to run such command Asterisk command from a php script executed by the apache user, in this case use AMI action and it will run fine doing Socket connection, and it will be real time adding some Jquery or Ajax auto refresh script
ambiorixg12
 
Posts: 453
Joined: Tue Sep 17, 2013 10:35 pm

Re: Vicidial asterisk with php

Postby williamconley » Thu Dec 05, 2019 3:13 pm

ambiorixg12 wrote:You wont be able to run such command Asterisk command from a php script executed by the apache user, in this case use AMI action and it will run fine doing Socket connection, and it will be real time adding some Jquery or Ajax auto refresh script

beware jquery access to ami. credentials will be exposed to the end user along with the requirement to open the port for ami access to the end user. put those together and anyone using that page can take over your system if you're not careful. Be sure you trust anyone on that page.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Vicidial asterisk with php

Postby ambiorixg12 » Thu Dec 05, 2019 8:28 pm

williamconley wrote:
ambiorixg12 wrote:You wont be able to run such command Asterisk command from a php script executed by the apache user, in this case use AMI action and it will run fine doing Socket connection, and it will be real time adding some Jquery or Ajax auto refresh script

beware jquery access to ami. credentials will be exposed to the end user along with the requirement to open the port for ami access to the end user. put those together and anyone using that page can take over your system if you're not careful. Be sure you trust anyone on that page.



It wont, Jquery will only access to the content of an external script and update it every 1 sec, Nothing will be exposed

Code: Select all
<html>


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script>
var auto_refresh = setInterval(
function()
{

  $('#loaddiv').load('call.php');
}, 1000);
</script>
<body>
<div id="loaddiv">
</div>

</body>
</html>
ambiorixg12
 
Posts: 453
Joined: Tue Sep 17, 2013 10:35 pm

Re: Vicidial asterisk with php

Postby williamconley » Mon Dec 09, 2019 3:51 pm

Which is why I said to beware jQuery access to AMI. The solution is to hard-code the AMI access into the back end, of course.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 99 guests