<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Trunk multi-tenant]]></title><description><![CDATA[<p dir="auto">Hi everyone !</p>
<p dir="auto">I have trouble with trunk and multi-tenant environement.</p>
<p dir="auto">For extension, everything work fine.<br />
But trunk not</p>
<pre><code>[DAHDI/1]
type=trunk
label=Test line

[DAHDI/2]
type=trunk
label=Line Office 1
channel=DAHDI/3&amp;DAHDI/4&amp;DAHDI/5&amp;DAHDI/6&amp;DAHDI/7&amp;DAHDI/8&amp;DAHDI/9&amp;DAHDI/10&amp;DAHDI/11&amp;DAHDI/12&amp;DAHDI/13

[DAHDI/1]
type=trunk
label=Line Office 2
channel=DAHDI/2&amp;DAHDI/3&amp;DAHDI/4&amp;DAHDI/5&amp;DAHDI/6
server=192.168.1.18
</code></pre>
<p dir="auto">All DAHDI channel are show under "Line Office 2"</p>
<p dir="auto">Also, does it's possible to monitor ring group ?</p>
]]></description><link>http://localhost:4567/topic/1733/trunk-multi-tenant</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 15:50:31 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/1733.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Feb 2014 21:23:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Trunk multi-tenant on Thu, 13 Mar 2014 14:42:32 GMT]]></title><description><![CDATA[<p dir="auto">Many thanks for sharing your solution!</p>
]]></description><link>http://localhost:4567/post/7504</link><guid isPermaLink="true">http://localhost:4567/post/7504</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Thu, 13 Mar 2014 14:42:32 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Thu, 13 Mar 2014 14:27:55 GMT]]></title><description><![CDATA[<p dir="auto">I slove my trouble with this PHP script.<br />
It's not perfect, but work<br />
The script rename channel to have unique channel name</p>
<pre><code>&lt;?
  // 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' =&gt; 'DAHDM/2-1',
                           'DAHDI/3-1' =&gt; 'DAHDM/3-1',
                           'DAHDI/4-1' =&gt;'DAHDM/4-1',
                           'DAHDI/5-1' =&gt; 'DAHDM/5-1',
                           'DAHDI/6-1' =&gt; 'DAHDM/6-1',
                           'DAHDI/7-1' =&gt; 'DAHDM/7-1',
                           'DAHDI/8-1' =&gt; 'DAHDM/8-1',
                           'DAHDI/9-1' =&gt; 'DAHDM/9-1',
                           'DAHDI/10-1' =&gt; 'DAHDM/10-1',
                           'DAHDI/11-1' =&gt; 'DAHDM/11-1',
                           'DAHDI/12-1' =&gt; 'DAHDM/12-1',
                           'DAHDI/13-1' =&gt; 'DAHDM/13-1',
                           'IAX2/' =&gt; 'IAX2M/',
                           'Parkinglot: default' =&gt; '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) &gt; 0) {
	            // Send to Asterisk
	            $from_Client = RenameChannel(1,$from_Client);
              fwrite($conn_asterisk, $from_Client);
              if ($debug) { echo "&gt;&gt;&gt; (" . strlen($from_Client) . ")" . $from_Client . "\n"; }
  	          AddToLog("&gt;&gt;&gt; (" . 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) &gt; 0) {
	            // Send to client
	            $from_Asterisk = RenameChannel(0,$from_Asterisk);
	            fwrite($conn_client, $from_Asterisk);
  	          if ($debug) { echo "&lt;&lt;&lt; (" . strlen($from_Asterisk) . ")" . $from_Asterisk . "\n"; }
  	          AddToLog("&lt;&lt;&lt; (" . 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 =&gt; $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();
    }
  }
?&gt;
</code></pre>
]]></description><link>http://localhost:4567/post/7503</link><guid isPermaLink="true">http://localhost:4567/post/7503</guid><dc:creator><![CDATA[secathor]]></dc:creator><pubDate>Thu, 13 Mar 2014 14:27:55 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Mon, 03 Mar 2014 20:03:08 GMT]]></title><description><![CDATA[<p dir="auto">What it is not possible is to track same channel names on separate asterisk boxes and have them represented by distinct buttons on fop2: nor dahdi, nor sip or any other tech. Same device name calls will show up on the same fop2 button regardless the server, as fop2 tracks by name.</p>
<p dir="auto">Maybe the wording is not correct, but multi tenant does not mean separate asterisk boxes, much like the opposite: having multiple clients/customers on ONE asterisk box. So the original question did not make sense to me at all.</p>
<p dir="auto">There are plenty of FOP2 installations on multitennant systems like Thirdlane, or custom built.</p>
<p dir="auto">Best regards,</p>
]]></description><link>http://localhost:4567/post/7502</link><guid isPermaLink="true">http://localhost:4567/post/7502</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Mon, 03 Mar 2014 20:03:08 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Mon, 03 Mar 2014 19:39:14 GMT]]></title><description><![CDATA[<p dir="auto">ok</p>
<p dir="auto">multi-tenant + trunk = not possible<br />
if DAHDI card are the same in both server</p>
]]></description><link>http://localhost:4567/post/7501</link><guid isPermaLink="true">http://localhost:4567/post/7501</guid><dc:creator><![CDATA[secathor]]></dc:creator><pubDate>Mon, 03 Mar 2014 19:39:14 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Mon, 03 Mar 2014 19:28:42 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">So, how can we add something before the last dash ?</p>
<p dir="auto">Thanks you</p>
</blockquote>
<p dir="auto">Not sure if its possible, but I am really not very into dahdi config or cards. If channels are from the same interface card, then I do not think you can add/remove or set anything. If you have different cards, then their names will be DAHDI/i1 /i2, and so forth.</p>
]]></description><link>http://localhost:4567/post/7500</link><guid isPermaLink="true">http://localhost:4567/post/7500</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Mon, 03 Mar 2014 19:28:42 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Mon, 03 Mar 2014 18:44:31 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">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:</p>
</blockquote>
<pre><code>[parkinglot_edvina]
context =&gt; edvinapark
parkext =&gt; 799
parkpos =&gt; 800-850
findslot =&gt; next
...
</code></pre>
<p dir="auto">I got it working, thanks you</p>
<blockquote>
<p dir="auto">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.</p>
</blockquote>
<blockquote>
<p dir="auto">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</p>
<p dir="auto">asterisk -rx "core show channels concise"</p>
<p dir="auto">Are the root of the names unique to each tenant? Think of it as this for a channel name:</p>
<p dir="auto">TECH/name-session</p>
<p dir="auto">session part is random and it is ignored. Anything before the last dash is the name fop2 uses to match, so if you have</p>
<p dir="auto">DAHDI/1-aabbccdd   for tenant 1</p>
<p dir="auto">and</p>
<p dir="auto">DAHDI/2-eeffgghh   for tenant 2</p>
<p dir="auto">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.</p>
</blockquote>
<p dir="auto">So, how can we add something before the last dash ?</p>
<p dir="auto">Thanks you</p>
]]></description><link>http://localhost:4567/post/7499</link><guid isPermaLink="true">http://localhost:4567/post/7499</guid><dc:creator><![CDATA[secathor]]></dc:creator><pubDate>Mon, 03 Mar 2014 18:44:31 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Sat, 01 Mar 2014 18:41:16 GMT]]></title><description><![CDATA[<p dir="auto">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.</p>
<p dir="auto">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:</p>
<pre><code>[parkinglot_edvina]
context =&gt; edvinapark
parkext =&gt; 799
parkpos =&gt; 800-850
findslot =&gt; next
...
</code></pre>
<p dir="auto">The only button type where the server=x.x.x.x line is relevant is the queue button.</p>
<p dir="auto">Best regards,</p>
]]></description><link>http://localhost:4567/post/7498</link><guid isPermaLink="true">http://localhost:4567/post/7498</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Sat, 01 Mar 2014 18:41:16 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Fri, 28 Feb 2014 13:31:08 GMT]]></title><description><![CDATA[<p dir="auto">ok I understand</p>
<p dir="auto">So the line</p>
<pre><code>server=ip of second server
</code></pre>
<p dir="auto">is totaly useless (I see it somewhere on the forum)</p>
<p dir="auto">Do you know how to rename DAHDI channel ?</p>
<p dir="auto">I also get same trouble for parking slot.<br />
Do you known how to rename it ?</p>
<p dir="auto">Thank you</p>
]]></description><link>http://localhost:4567/post/7497</link><guid isPermaLink="true">http://localhost:4567/post/7497</guid><dc:creator><![CDATA[secathor]]></dc:creator><pubDate>Fri, 28 Feb 2014 13:31:08 GMT</pubDate></item><item><title><![CDATA[Reply to Trunk multi-tenant on Fri, 28 Feb 2014 12:26:05 GMT]]></title><description><![CDATA[<p dir="auto">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</p>
<p dir="auto">asterisk -rx "core show channels concise"</p>
<p dir="auto">Are the root of the names unique to each tenant? Think of it as this for a channel name:</p>
<p dir="auto">TECH/name-session</p>
<p dir="auto">session part is random and it is ignored. Anything before the last dash is the name fop2 uses to match, so if you have</p>
<p dir="auto">DAHDI/1-aabbccdd   for tenant 1</p>
<p dir="auto">and</p>
<p dir="auto">DAHDI/2-eeffgghh   for tenant 2</p>
<p dir="auto">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.</p>
<p dir="auto">Regarding ringgroups, they are not devices, just a logical dialplan config that can be done in a zillion ways, so they cannot be monitored as an entity, as they are not. You can have ring group buttons but only for use as a transfer target.</p>
<p dir="auto">Best regards,</p>
]]></description><link>http://localhost:4567/post/7496</link><guid isPermaLink="true">http://localhost:4567/post/7496</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Fri, 28 Feb 2014 12:26:05 GMT</pubDate></item></channel></rss>