<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 13, 2013 at 9:31 AM, Fabio Moretti <span dir="ltr">&lt;<a href="mailto:fmoretti@tecytal.com" target="_blank">fmoretti@tecytal.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi, I&#39;ve already post this to the forum three days ago, sorry if it&#39;s<br>

sounds like a crosspost, but I&#39;ve got no replies, so I&#39;m trying other<br>
channels :)<br>
<br>
This is the link to the forum post if someone prefer to reply here:<br>
<a href="http://forums.asterisk.org/viewtopic.php?f=1&amp;t=86985" target="_blank">http://forums.asterisk.org/viewtopic.php?f=1&amp;t=86985</a><br>
<br>
I&#39;m using Asterisk 1.8.20.0 (the freepbx build) with CEL logging<br>
activated. I&#39;m using CEL because in our pbx we have different queues and<br>
trunks serving different customers (we are an inbound call center) and<br>
we need to detect when and how we have to bill our customers.<br>
I&#39;m facing an issue with the call transfer, for example I have:<br>
- call entering a queue<br>
- operator answer the call<br>
- operator make an outgoing call to reach the customer<br>
- operator put in communication the ingoing call with the outgoing<br>
this result in various channel to be created/destroyed, and I&#39;m using<br>
bridge events to detect what is going on with the call. In this case I<br>
have (I&#39;ve hidden CHAN_START,ANSWER and HANGUP events because they have<br>
no useful information in this case):<br>
<br>
+--------+---------------+---------------------+-------+---------------------+----------------------------------+---------+-----------------------------+----------------------------------+<br>
<br>
| id     | eventtype     | eventtime           | exten | context             | channame                         | appname | appdata                     | peer                             |<br>
<br>
+--------+---------------+---------------------+-------+---------------------+----------------------------------+---------+-----------------------------+----------------------------------+<br>
<br>
| 965224 | BRIDGE_START  | 2013-06-10 10:15:18 | 20    | ext-queues          | DAHDI/i1/96034296-30a3           | Queue   | 20,t,,                      | Local/1004@from-queue-00019c34;1 |<br>
<br>
| 965226 | BRIDGE_START  | 2013-06-10 10:15:18 | s     | macro-dial-one      | Local/1004@from-queue-00019c34;2 | Dial    | SIP/1004,&quot;&quot;,trM(auto-blkvm) | SIP/1004-000040ce                |<br>
<br>
| 965340 | BRIDGE_UPDATE | 2013-06-10 10:16:08 | s     | macro-dialout-trunk | Local/1004@from-queue-00019c34;2 | Dial    | IAX2/issuegroup/110,300,    | IAX2/issuegroup-17175            |<br>
<br>
| 965513 | BRIDGE_END    | 2013-06-10 10:18:15 | 20    | ext-queues          | DAHDI/i1/96034296-30a3           | Queue   | 20,t,,                      | Local/1004@from-queue-00019c34;1 |<br>
<br>
| 965515 | BRIDGE_END    | 2013-06-10 10:18:15 | s     | macro-dialout-trunk | Local/1004@from-queue-00019c34;2 | Dial    | IAX2/issuegroup/110,300,    | IAX2/issuegroup-17175            |<br>
<br>
+--------+---------------+---------------------+-------+---------------------+----------------------------------+---------+-----------------------------+----------------------------------+<br>
<br>
<br>
The first BRIDGE_START is the connection between the inbound call<br>
(DAHDI/i1/96034296-30a3) and the local phone<br>
(Local/1004@from-queue-00019c34;1), the second BRIDGE_START is the<br>
connection between the local phone (Local/1004@from-queue-00019c34;2)<br>
and the outgoing call (SIP/1004-000040ce) that is going out by a IAX trunk.<br>
After that I have a BRIGDE_UPDATE event where no field make me know<br>
which channel is being updated, I only have the channame<br>
(Local/1004@from-queue-00019c34;2) that is the channel being bridged out<br>
and the outgoing channel (IAX2/issuegroup-17175), but I have no<br>
information that in fact the ingoing call (DAHDI/i1/96034296-30a3) is<br>
being bridged to the outgoing channel.<br>
I have no other event (TRANSFER or something like that) to know what is<br>
going on.<br>
<br></blockquote><div><br></div><div style>&lt;snip&gt;</div><div style><br></div><div style>I think you have two questions here: what is the BRIDGE_UPDATE event telling you, and how do you know the DAHDI channel is communicating with the IAX trunk.</div>
<div style><br></div><div style>A BRIDGE_UPDATE event occurs when a masquerade has happened and the participants in a bridge have been updated. In this particular case, the BRIDGE_UPDATE event is telling you that Local/1004@from-queue-00019c34;2 is no longer bridged with SIP/1004-000040ce, but is in fact now bridged with the IAX trunk IAX2/issuegroup-17175. That is, the IAX trunk has taken the place of the SIP channel. Since you were already informed that a bridge started between that Local channel half and the SIP channel, the event only needs to tell you who got replaced - which is what it does.</div>
<div style><br></div><div style>So, how do you know that Local/1004@from-queue-00019c34;2 is associated with DAHDI/i1/96034296-30a3?</div><div style><br></div><div style>By definition, Local channels *always* exist in pairs - the two channels together make up one path of communication. The two halves are denoted by a common name with a suffix of &#39;;1&#39; and &#39;;2&#39; - the first half gets the &#39;;1&#39;; the second half gets the &#39;;2&#39;. When both halves are answered, you know that audio will be forwarded from one half to the other and vice versa.</div>
<div style><br></div><div style>Since you know that DAHDI/i1/96034296-30a3 is in a bridge with Local/1004@from-queue-00019c34;1 and Local/1004@from-queue-00019c34;2<b> </b>is in a bridge with IAX2/issuegroup-17175, you automatically know that DAHDI/i1/96034296-30a3 and IAX2/issuegroup-17175 can communicate (at least once everyone has Answered). The system you build on top of CEL has to understand the semantics of Local channels and tie the two together.</div>
</div><div class="gmail_extra"><br></div>Matt<br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div>
<div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> &amp; <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</div></div>