Yes, the hangup problem are fixed
Also, editing /usr/local/fop2/autoconfig-users.sh is useless. FOP2 Manager can add user
Only need to edit file /usr/local/fop2/buttons_custom.cfg
Yes, the hangup problem are fixed
Also, editing /usr/local/fop2/autoconfig-users.sh is useless. FOP2 Manager can add user
Only need to edit file /usr/local/fop2/buttons_custom.cfg
My solution was easy
First, to add user form my second Asterisk
I edited /usr/local/fop2/autoconfig-users.sh
And after :
echo "; Users"
I added line
echo "user= EXTENSION : SECRET : PERMISSIONS : GROUPS : PLUGINS
For adding extension
I edited /usr/local/fop2/buttons_custom.cfg
And added each extension
After these modification, I goes to FOP2 Manager and reload FOP2
extension are now visible in FOP2
Of course, this modification are not dymanic, if I add or remove extension on my second Asterisk I need to adjust file /usr/local/fop2/buttons_custom.cfg
Like I say in my other post (http://forum.fop2.com/4314-variable-blindtransfer-is-empty). I have copied default config files. This will maybe slove this issue too.
Does it's possible with FOP2 Manager to add extension button from second Asterisk ?
Thank you
I read file /plugins/README from the tarball
I have create folder /var/www/html/fop2/admin/plugins/myblindvalue
Create file plugin.xml (used one from sample plugin)
Create file myblindvalue.pl and copy your script with remplacing 'sampleplugin' by 'myblindvalue'
Edit /usr/local/fop2/fop2.cfg, and add line
plugin=myblindvalue:/var/www/html/fop2/admin/plugins/myblindvalue
And add to my user
user=119:password:all::myblindvalue
I also add the clock plugin
The clock work but the myblindvalue plugin won't work
I have start FOP2 with all debug (/usr/local/fop2/fop2_server -X 511 -l /var/log/fop2)
And if I search for "Setvar" in the log file. I only found line for variable PICKUPMARK
Where I put this Perl script ?
Inside new file in directory /usr/local/fop2 ?
Or inside new file in new directory in /var/www/html/fop2/admin/plugins ?
I have try both, nothing seem to work, does I need to do something more to activate the script ?
Thanks you
Does it exist an solution for this ?
When we do an blind transfer from the phone, Asterisk set BLINDTRANSFER variable automaticly.
But when we do an transfer from FOP2 panel, the BLINDTRANSFER variable was not set
From : http://forum.fop2.com/3497-no-blindtransfer-set/0
I have try to edit FOP2Callbacks.pm
But after modification, FOP2 won't start
From : http://forum.fop2.com/4165-fop2-la-variable-blindtransfer-llega-vac-a/0#p11614
But don't seem to have solution ?
Hi ! We got trouble since we have update FOP2 to 2.31.
We had 2.26 before, and FOP2 as working great
Now, extension button from second Asterisk won't hangup.
My first Asterisk is an FreePBX 2.11.0.38 (with Asterisk 11.8.1 with FOP2) (have extension 1xx)
My second Asterisk is an Elastix (with Asterisk 1.8.16.0) (have extension 2xx)
Both Asterisk can communicate between them without trouble
If 119 call 219, FOP2 show both as talking, but if the call end, only 119 return to idle (green color), 219 stay as talking until I restart FOP2
I slove my trouble with this PHP script.
It's not perfect, but work
The script rename channel to have unique channel name
<?
// Debug
$debug = false;
// Asterisk server
$asterisk_ip = "192.168.0.20";
$asterisk_port = 5038;
// Listen IP and port
$listen_ip = '0.0.0.0';
$listen_port = '5858';
// Start as daemon
become_daemon();
// Init some value
set_time_limit(0);
ob_implicit_flush();
// Replace channel name
$rename_chan = array( 'DAHDI/2-1' => 'DAHDM/2-1',
'DAHDI/3-1' => 'DAHDM/3-1',
'DAHDI/4-1' =>'DAHDM/4-1',
'DAHDI/5-1' => 'DAHDM/5-1',
'DAHDI/6-1' => 'DAHDM/6-1',
'DAHDI/7-1' => 'DAHDM/7-1',
'DAHDI/8-1' => 'DAHDM/8-1',
'DAHDI/9-1' => 'DAHDM/9-1',
'DAHDI/10-1' => 'DAHDM/10-1',
'DAHDI/11-1' => 'DAHDM/11-1',
'DAHDI/12-1' => 'DAHDM/12-1',
'DAHDI/13-1' => 'DAHDM/13-1',
'IAX2/' => 'IAX2M/',
'Parkinglot: default' => 'Parkinglot: defaultm',
);
// Main loop
$infinite_loop = true;
if ($debug) { $infinite_loop = false; }
do {
AddToLog("Main loop start.\n");
// Start listen
unset ($socket);
unset($conn_client);
$socket = stream_socket_server("tcp://0.0.0.0:" . $listen_port, $errno, $errstr);
if (!$socket) {
die("Unable to bind socket : $errstr ($errno) \n");
} else {
$conn_client = stream_socket_accept($socket);
stream_set_blocking($conn_client, 0);
}
// Connect to Asterisk
unset ($conn_asterisk);
$conn_asterisk = @fsockopen($asterisk_ip, $asterisk_port, $errno, $errstr, 30);
if (!$conn_asterisk) {
die("Unable to connect to Asterisk : $errstr ($errno) \n");
} else {
stream_set_blocking($conn_asterisk, 0);
}
// Start loop
$loop = true;
do {
// Read from Client
$from_Client = @fread($conn_client, 2048);
if (@feof($conn_client) || (!$conn_client)) {
// Client disconnect
$loop = false;
} elseif ( strlen($from_Client) > 0) {
// Send to Asterisk
$from_Client = RenameChannel(1,$from_Client);
fwrite($conn_asterisk, $from_Client);
if ($debug) { echo ">>> (" . strlen($from_Client) . ")" . $from_Client . "\n"; }
AddToLog(">>> (" . strlen($from_Client) . ")" . $from_Client . "\n");
}
// Read from Asterisk
$from_Asterisk = @fread($conn_asterisk, 2048);
if (@feof($conn_asterisk) || (!$conn_asterisk)) {
// Client disconnect
$loop = false;
} elseif ( strlen($from_Asterisk) > 0) {
// Send to client
$from_Asterisk = RenameChannel(0,$from_Asterisk);
fwrite($conn_client, $from_Asterisk);
if ($debug) { echo "<<< (" . strlen($from_Asterisk) . ")" . $from_Asterisk . "\n"; }
AddToLog("<<< (" . strlen($from_Asterisk) . ")" . $from_Asterisk . "\n");
}
// Little break
usleep(100);
} while($loop);
// Close everyone
// Close Asterisk
@fclose($conn_asterisk);
unset($conn_asterisk);
// Close client
@fclose($conn_client);
unset ($socket);
unset($conn_client);
// Big break before restarting
usleep(3000);
} while($infinite_loop);
AddToLog("Bye!\n");
// Rename channel
function RenameChannel($direction, $data) {
GLOBAL $rename_chan;
$r = $data;
foreach ($rename_chan as $key => $value) {
if ($direction == 0) {
$r = str_ireplace($key, $value, $r);
} else {
$r = str_ireplace($value, $key, $r);
}
}
return $r;
}
// Add to log
function AddToLog($data) {
GLOBAL $debug;
if ($debug) {
$i = file_put_contents( "/tmp/php_relay.log",
$data,
FILE_APPEND);
}
}
// Daemon
function become_daemon() {
$pid = pcntl_fork();
if ($pid == -1) {
/* fork failed */
echo "fork failure!\n";
exit();
}elseif ($pid) {
/* close the parent */
exit();
} else {
/* child becomes our daemon */
posix_setsid();
chdir('/');
umask(0);
return posix_getpid();
}
}
?>
ok
multi-tenant + trunk = not possible
if DAHDI card are the same in both server
As for parking, you can create a separate channel parking lot name in features.conf. This is the sample provided in the asterisk sample config files:
[parkinglot_edvina]
context => edvinapark
parkext => 799
parkpos => 800-850
findslot => next
...
I got it working, thanks you
As far as I know, dahdi channels cannot be reanamed, they are set by the channel driver depending on the card/line number set in your chan_dahdi.conf file or similar.
multi tenant or not is not the question. FOP2 monitor channels by device name, so if you have distinct device names for each tenant, or provider, or whatever, then you can have separate buttons for them. Look at the channel names when you make a call from one tenant or the other, and check names with
asterisk -rx "core show channels concise"
Are the root of the names unique to each tenant? Think of it as this for a channel name:
TECH/name-session
session part is random and it is ignored. Anything before the last dash is the name fop2 uses to match, so if you have
DAHDI/1-aabbccdd for tenant 1
and
DAHDI/2-eeffgghh for tenant 2
Then you can use two separate buttons (DAHDI/1 and DAHDI/2) for each tenant. In the other hand if you have DAHDI/1-xxxx and DAHDI/1-yyyyy for those tenants, then there is no way to discern who is who.
So, how can we add something before the last dash ?
Thanks you
ok I understand
So the line
server=ip of second server
is totaly useless (I see it somewhere on the forum)
Do you know how to rename DAHDI channel ?
I also get same trouble for parking slot.
Do you known how to rename it ?
Thank you
Hi everyone !
I have trouble with trunk and multi-tenant environement.
For extension, everything work fine.
But trunk not
[DAHDI/1]
type=trunk
label=Test line
[DAHDI/2]
type=trunk
label=Line Office 1
channel=DAHDI/3&DAHDI/4&DAHDI/5&DAHDI/6&DAHDI/7&DAHDI/8&DAHDI/9&DAHDI/10&DAHDI/11&DAHDI/12&DAHDI/13
[DAHDI/1]
type=trunk
label=Line Office 2
channel=DAHDI/2&DAHDI/3&DAHDI/4&DAHDI/5&DAHDI/6
server=192.168.1.18
All DAHDI channel are show under "Line Office 2"
Also, does it's possible to monitor ring group ?