secathor

Member

Last active 7 years ago

  1. 8 years ago
    Wed Aug 31 13:02:25 2016

    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

  2. Tue Aug 30 20:24:05 2016

    My solution was easy

    First, to add user form my second Asterisk
    I edited /usr/local/fop2/autoconfig-users.sh
    And after : [code]echo "; Users"[/code]
    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

    * And extension state on my second Asterisk update correctly in FOP2

  3. Thu Aug 25 20:09:02 2016

    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 ?

  4. Thu Aug 25 19:49:25 2016
    secathor posted in Variable BLINDTRANSFER is empty.

    I have removed all config files in /usr/local/fop2/ and copied default files from fop2 tarball
    I also put the perl script in "clock.pl" of the clock plugins (/var/www/html/fop2/admin/plugins/clock/) and use FOP2 Manager to enable clock

    Now, it's work !

  5. Tue Aug 23 14:10:24 2016
    secathor posted in Variable BLINDTRANSFER is empty.

    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

  6. Mon Aug 22 14:58:46 2016
    secathor posted in Variable BLINDTRANSFER is empty.

    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

  7. Fri Aug 19 20:18:59 2016
    secathor started the conversation Variable BLINDTRANSFER is empty.

    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 ?

  8. Fri Aug 19 20:09:45 2016
    secathor started the conversation Multi-Tenant : Extension won't update.

    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

  9. 10 years ago
    Thu Mar 13 14:27:55 2014
    secathor posted in Trunk multi-tenant.

    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();
        }
      }
    ?>
  10. Mon Mar 3 19:39:14 2014
    secathor posted in Trunk multi-tenant.

    ok

    multi-tenant + trunk = not possible
    if DAHDI card are the same in both server

View more