<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 3, 2018 at 12:20 AM Calum Power <<a href="mailto:Calum.Power@aad.gov.au">Calum.Power@aad.gov.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<div>Hi asterisk-users,</div>
<div><br>
</div>
<div>We have recently moved to the 13.x branch of Asterisk from 11.x, and we're trying to correlate CDR records from multiple-legs for billing purposes.</div>
<div>As part of this change we have added 'linkedid' to our CDR table schema in an attempt to join the multiple records into one billable record.</div>
<div><br>
</div>
<div>
<div>The call path can be simplified as (transport types in brackets):</div>
<div>SIP Phone---(SIP)---Asterisk Svr1---(IAX)---Asterisk Svr2---(IAX)---Asterisk Svr3---(SIP)---PSTN</div>
</div>
<div><br>
</div>
<div>As per the CDR spec, I expected the 'linkedid' to propagate between the records and be the same throughout...</div>
<div>However, we observe differing linkedid values for the same call... Thus (xxx's added for privacy):</div>
<div>| id      | calldate            | src            | dst        | accountcode | uniqueid          | linkedid         | billsec | duration |</div>
<div>| 5031920 | 2018-10-03 01:51:41 | 0362xxxxxx     | 0449xxxxxx |             | 1538531501.18974  | 1538531501.18974 |      64 |       71 |</div>
<div></div>
<div></div>
<div>| 5031921 | 2018-10-03 01:52:52 | 6613           | 0449xxxxxx | 759553      | 1538531488.11368  | 1538531488.11368 |       0 |        0 |</div>
<div><br>
</div>
<div>Noting that our out-dial from Svr2 changes the CLID to 0362xxxxxx as we must present that CLID to our PSTN upstream provider as per their requirements.
</div>
<div><br>
</div>
<div>The first record is taken from Asterisk Svr2, the second from Asterisk Svr1 (Svr1 replicates MySQL to Svr2)</div>
<div>As you can see, the linkedid records are different (1538531501.18974 vs 1538531488.11368)</div>
<div><br>
</div>
<div>The difference appears to be the matter of microsecs that it takes to connect the call legs (over a satellite connection) so I could probably 'guess' that these two are the same call, however for billing purposes this is not accurate enough.</div>
<div><br>
</div>
<div>Can someone shed some light on why the linkedid is not being shared between IAX channels?</div></div></blockquote><div><br></div><div>Linkedid is not propagated between Asterisk boxes.  A linkedid is just the uniqueid of the oldest associated channel <br></div><div>within the Asterisk box.  Uniqueid's are unique within an Asterisk box and can be made unique across Asterisk boxes <br></div><div>by optionally adding the host name.<br></div><div><br></div><div>Richard</div><br></div></div>