<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Thanks Vladyslav.</p>
<p><br>
</p>
<p>After reading your reply I found relevant information under the originating_leg_uuid section of the Channel Variables confluence page.</p>
<p><br>
</p>
<p>I tried modifying the Dialplan entry on the server to include both ${uuid} and $(call_uuid} in the name of the session recording file as follows</p>
<p><br>
</p>
<p></p>
<div><extension name="Test Dialplan entry"></div>
<div>  <condition field="destination_number" expression="^(4008)$"></div>
<div><span style="white-space:pre"></span><action application="export" data="execute_on_answer=record_session $${base_dir}/recordings/${strftime(%Y.%m.%d_%H.%M.%S)}_${uuid}_.${call_uuid}._${caller_id_number}.wav"/></div>
<div><span style="white-space:pre"></span><action application="export" data="dialed_extension=$1"/></div>
<div><span style="white-space:pre"></span><action application="set" data="call_timeout=30"/></div>
<div><span style="white-space:pre"></span><action application="set" data="hangup_after_bridge=true"/></div>
<div><span style="white-space:pre"></span><action application="set" data="continue_on_fail=true"/></div>
<div><span style="white-space:pre"></span><action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/></div>
<div><span style="white-space:pre"></span><action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/></div>
<div><span style="white-space:pre"></span><action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/></div>
<div><span style="white-space:pre"></span><action application="hash" data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/></div>
<div><span style="white-space:pre"></span><action application="hash" data="insert/${domain_name}-last_dial_ext/global/${uuid}"/></div>
<div><span style="white-space:pre"></span><action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/></div>
<div><span style="white-space:pre"></span><action application="bridge" data="user/$1@${domain_name}"/></div>
<div><span style="white-space:pre"></span><action application="answer"/></div>
<div>  </condition></div>
<div></extension></div>
<p></p>
<p><br>
</p>
<p>but the name generated had the same Guid for both uuid and call_uuid (which suggests that it's the a-leg).</p>
<p><br>
</p>
<p><br>
</p>
<p>My client issues a call to a number using embedded FreeSWITCH as follows:</p>
<p><br>
</p>
<p>FreeSWITCH.Native.Api.Execute("pa", "call sofia/gateway/<gateway>/<number> XML <caller Id> <caller name>")</p>
<p><br>
</p>
<p>and gets back a response like</p>
<p><br>
</p>
<p><span>SUCCESS:<call number>:<Guid></span></p>
<p><span><br>
</span></p>
<p><span>The Guid in the response looks like it should be a call Id because it'd the same Guid that appears in the Unique-ID headers of the FreeSWITCH events that the client receives - it just doesn't seem to match the Guid(s) used by the server when it'd generating
 the recording name. Is there any way for the client FreeSWITCH to know or gain access to the IDs being used by the FreeSWITCH server?</span></p>
<p><span><br>
</span></p>
<p><span>Paul</span></p>
<p><br>
</p>
<p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> FreeSWITCH-users <freeswitch-users-bounces@lists.freeswitch.org> on behalf of Vladyslav Zakhozhai <v.zakhozhai@gmail.com><br>
<b>Sent:</b> 14 August 2017 16:41:13<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] Channel variables on a-leg and b-leg</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi Paul,
<div><br>
</div>
<div>${uuid} - is Unique Id of channel. For a-leg and b-leg it will be different (I mean that uuid is not Call-ID). You can try to use call_uuid instead. But I'm not sure about that.</div>
<div><br>
</div>
<div>I think that you can use set instead of export and fetch recording data from a-leg. I'm using such approach and do not experience any problems with that.<br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Aug 14, 2017 at 5:01 PM, Paul Mateer <span dir="ltr">
<<a href="mailto:Paul.Mateer@outlook.com" target="_blank">Paul.Mateer@outlook.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-6016927410727562819divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p></p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
Guys, I'm using the C# interface to FreeSWITCH to add the ability to make and receive calls in an existing software application.</p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<br>
</p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
I want to record the conversations on the server, but I need to be able to access the recording after the call is complete.</p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
The Call-ID value seemed the perfect solution to this and I <span style="font-size:12pt">added the following action to my dialplan entry.</span></p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
</p>
<div style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="white-space:pre-wrap"></span><action application="export" data="execute_on_answer=<wbr>record_session $${base_dir}/recordings/${<wbr>strftime(%Y.%m.%d_%H.%M.%S)}_$<wbr>{uuid}_${caller_id_number}.<wbr>wav"/></div>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
</p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<br>
</p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="font-size:12pt">This seemed to work fine, as I would get recording files created with a Guid in the name, but on closer inspection I found that the Guid used in the filename was not the same Guid associated with the successfully placed call in
 the application. </span><span style="font-size:12pt">I assume that this is because the </span><span style="font-size:12pt">application sees the Call-ID for the a-leg, whereas the dialplan entry is executed in the b-leg and therefore has it's own separate Guid.</span><br>
</p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="font-size:12pt"></span></p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="font-size:12pt"><br>
</span></p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="font-size:12pt">Is there any way in which I can expose the Call-ID (or some other custom channel variable) for the a-leg to the b-leg so that it will be accessible within the XML dialplan and therefore be usable when creating the recording file?</span></p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="font-size:12pt"><br>
</span></p>
<p style="font-family:Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:16px">
<span style="font-size:12pt">Thanks for any suggestions/assistance offered.</span></p>
<div><span style="font-size:12pt"><br>
</span></div>
<br>
<p></p>
</div>
</div>
<br>
______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.<wbr>freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.<wbr>org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.<wbr>freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/<wbr>mailman/listinfo/freeswitch-<wbr>users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.<wbr>freeswitch.org/mailman/<wbr>options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">С уважением,<br>
Владислав Захожай<br>
<br>
</div>
</div>
</div>
</div>
</body>
</html>