bar top left
bar top right
left curve
right curve
Welcome, Guest

vTiger PBX Manager setup for click to call
(1 viewing) (1) Guest
Go to bottom
Post Reply
Post New Topic
Page: 123
TOPIC: vTiger PBX Manager setup for click to call
*
#61426
vTiger PBX Manager setup for click to call 1 Year, 7 Months ago Karma: 7
Just got Elastix 2 installed on my server and it has vTiger 5.1.0 integrated in it. But could not find any info how to configure PBX Manager. After figuring out (not so difficult if you know thing or 2 about trixbox or elastix and AMI)I was able click-to-call local extencions but not SIP outbound trunks. Was saying "good buy".

So here what I had to do to make it work:

(make shure you have extencion number under user profile)

PBX>Tools>Asterisk File Editor

Open and edit manager_custom.conf:

[vTiger]
secret=yourpasswordhere
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,dialplan
write = system,call,log,verbose,command,agent,user,originate

Connect to SSH and:

su -
asterisk -r
manager reload
manager show user vTiger

In vTiger go to Module Manager>PBX Manager>Edit


Asterisk server IP: 127.0.0.1
Asterisk server port: 5038
Asterisk username: vTiger
Asterisk password: yourpasswordhere

Edit file /var/www/html/vtigercrm/modules/PBXManager/utils/AsteriskClass.php
and find "$context =" and replace with "$context = "from-internal";"

>nano /var/www/html/vtigercrm/modules/PBXManager/utils/AsteriskClass.php


/**
* create a call between from and to
* @param string $from - the from number
* @param sring $to - the to number
* this function prepares the parameter $context and calls the createCall() function
*/
function transfer($from,$to){
$this->log->debug("in function transfer($from, $to)");
if(empty($from) || empty($to)) {
echo "Not sufficient parameters to create the call";
$this->log->debug("Not sufficient parameters to create the call");
return false;
}

//the caller would always be a SIP phone in our case
if(!strstr($from,"SIP")){
$from = "SIP/$from";
}
if(strpos($to, ":")!==FALSE){
$arr = explode(":", $to);
if(is_array($arr)){
$typeCalled = $arr[0];
$to = trim($arr[1]);
}
}

switch($typeCalled){
case "SIP":
$context = "from-internal";
break;
case "PSTN":
$context = "from-internal";//"outbound-dialing";
break;
default:
$context = "from-internal";
}
$this->createCall($from, $to, $context);
}


Thats it. Click-to-call worked for me. Hope this helps somebody.
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
Maag
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
#62139
Re: vTiger PBX Manager setup for click to call 1 Year, 7 Months ago Karma: 0
Thanks!! It works perfect!
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
dai_ig
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Daitec
Reply Quote
 
#69462
Re:vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 0
Thanks man iam Mexico, I did what you said and it worked, thank you!
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
okar
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
#69897
Re: vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 0
Hi, I'm from chile and my English is not very good but in end.

my question is I need to do click to call via web service and I have mounted elastix on a machine, you would be very kind to help me to get this service but I want to do something like this. but not in flash, if not with PHP.

Greetings.


Links hidden for unregistered users. Login or register Here

in spanish

hola, soy de chile y mi ingles no es muy bueno pero en fin.

mi pregunta es que necesito hacer un servicio clic para llamar via web y ya tengo montado elastix en una maquina, tu serias muy amable de ayudarme para lograr este servicio mi idea es hacer algo como esto. pero no en flash si no con PHP.

Saludos.
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
skin_head77
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
#69899
Re: vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 118
welcome to the club that really help here! and studying or searching also ... you diserve my karma upgrade!
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
fmvillares
Asterisk DCAP and Ex-Elastix Partner
Gold Boarder
Posts: 1785
graphgraph
User Offline Click here to see the profile of this user
Gender: Male fernando (dot) villares Intelix Ingeniería fmvillares (at) hotmail.com Location: Rosario Birthday: 07/03
Reply Quote
 
#69900
Re: vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 2
Me facino verlo... y no me lo creei
tinyurl.com/4ahrq3p
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
mm.alpha2k
Senior Boarder
Posts: 165
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: Argentina Buenos Aires Birthday: 11/05
ECE#201405641
Reply Quote
 
#70103
Re: vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 7
There are bunch of scripts online for that.
Here is one I am using:
(just create click2call.php, check permissions, copy paste all this and change settings in it the way you need it (like vTiger password))

<html>
<head>
<title>Click2Dial</title>
</head>
<body>
<?php
#Based on the Click-To-Call script brought to you by VoipJots.com
#Modified by Rafael Cortes for Asterisk PBXS www.asteriskpbxs.com
#Slightly modified by NerdVittles.com for your calling pleasure.

#------------------------------------------------------------------------------------------
#edit the below variable values to reflect your system/information
#------------------------------------------------------------------------------------------

#specify the name/ip address of your asterisk box
#if your are hosting this page on your asterisk box, then you can use
#127.0.0.1 as the host IP. Otherwise, you will need to edit the following
#line in manager.conf, under the Admin user section:
#permit=127.0.0.1/255.255.255.0
#change to:
#permit=127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx ;(the ip address of the server this page is running on)
$strHost = "127.0.0.1";

#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf)
#this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH.
$strUser = "vTiger";

#specify the password for the above user
$strSecret = "vTigerpassword";

#specify the channel (extension) you want to receive the call requests with
#e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, local/1NXXNXXXXXX@from-internal, etc
#$strChannel = "local/1NXXNXXXXXX@from-internal";Use this for your cell phone Number;
$strChannel = "local/3001@from-vtiger";

#specify the context to make the outgoing call from. By default, AAH uses from-internal
#Using from-internal will make you outgoing dialing rules apply
$strContext = "from-internal";

#specify the amount of time you want to try calling the specified channel before hangin up
$strWaitTime = "30";

#specify the priority you wish to place on making this call
$strPriority = "1";

#specify the maximum amount of retries
$strMaxRetry = "2";

#--------------------------------------------------------------------------------------------
#Shouldn't need to edit anything below this point to make this script work
#--------------------------------------------------------------------------------------------
#get the phone number from the posted form
$strExten = $_GET['number'];
#
# $strName = $_POST['txtname'];
$strExten = $_POST['txtphonenumber'];
#

$callNumber = $strExten;
#specify the caller id for the call
$strCallerId = "Web-".$strName . " <$callNumber>";

$length = strlen($strExten);

if ($length == 10 && is_numeric($strExten))
{

$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed");
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $strChannel\r\n");
fputs($oSocket, "WaitTime: $strWaitTime\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Exten: $strExten\r\n");
fputs($oSocket, "Context: $strContext\r\n");
fputs($oSocket, "Priority: 1\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
sleep(3);
fclose($oSocket);
?>
<p>
<table width="300" border="1" bordercolor="#0f0f0f" cellpadding="3" cellspacing="0">
<tr><td>
<font size="2" face="verdana,arial,georgia"
color="#000000">Enter 10-digit number (e.g. 7875551234).</font>
<form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post" name="myform">


Number: <input type="text" size="30" maxlength="10" name="txtphonenumber"><br><br>
<body onload="document.myform.txtphonenumber.focus()">
<center><input type="submit"
value="Call Me Now"></center>
</form>
</td></tr>
</table>
</p>

<!--

<body onload="window.close();">
</body>
-->






<?
}
else
{
?>
<p>
<table width="300" border="1" bordercolor="#0f0f0f" cellpadding="3" cellspacing="0">
<tr><td>
<font size="2" face="verdana,arial,georgia"
color="#000000">Enter 10-digit number (e.g. 7875551234).</font>
<form action="<? echo $_SERVER['PHP_SELF'] ?>" method="post" name="myform">


Number: <input type="text" size="30" maxlength="10" name="txtphonenumber"><br><br>
<body onload="document.myform.txtphonenumber.focus()">
<center><input type="submit"
value="Call Me Now"></center>
</form>
</td></tr>
</table>
</p>

<!--

<body onload="window.close();">
</body>

-->



<?
}
?>
</body>
</html>
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
Maag
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
#70104
Re: vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 7
This will dial the number and connect it to extension 3001. I was using it with my gandstream phone with auto answer to quickly call numbers from exel file
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
Maag
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
#70271
Re: vTiger PBX Manager setup for click to call 1 Year, 3 Months ago Karma: 1
the first post worked for me. Awsome thanks so much.
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
kingjm
Fresh Boarder
Posts: 29
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
#71917
Re: vTiger PBX Manager setup for click to call 1 Year, 2 Months ago Karma: 0
El primer post me funcionó perfecto. Excelente post Maag!!! Muchas gracias.
Enter code here   
Please note: although no board code and smiley buttons are shown, they are still usable.
acorreaedwards@gmail.com
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Reply Quote
 
Go to top
Post Reply
Post New Topic
Page: 123
Moderators: Bob, jgutierrez
Protected by Spam Fighter