[Freeswitch-users] Channel variables on a-leg and b-leg

Paul Mateer paul.mateer at gmail.com
Tue Aug 15 14:35:06 UTC 2017


Sorry. I've had to switch to a different mail account because each
time I try to reply I get a "you must be a member to post to this
list" message, even though I'm already subscribed.


Anyway, I don't have an issue with the use of the a-leg uuid. I think
my problem stems from an assumption that the ids would be the same on
the client and the server.


I have a client UA which is placing a call through the server, which in
turn is recording the conversation. The client needs a unique way of
identifying the filename used in the recording and the use of the uuid
seemed like a suitable way of identifying the file.

However I've realised that the call Id returned as a response to the pa
call issued is a client-side id and doesn't correlate with the call id used
at the server end of things. Is there any way for the client to know the
call used by the server, or is there a way for the client to provide a
custom id that will be accessible to the server when processing the
dialplan?


> The answer is all of these uuid’s are being used by the server, 1 for a leg, and one for each b leg.  Why do you have an issue with using the a leg uuid?

>* On Aug 14, 2017, at 1:08 PM, Paul Mateer <paul.mateer at outlook.com <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>> wrote:
*> >* Thanks Vladyslav.
*> >* After reading your reply I found relevant information under the
originating_leg_uuid section of the Channel Variables confluence page.
*> >* 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
*> >* <extension name="Test Dialplan entry">
*>*   <condition field="destination_number" expression="^(4008)$">
*>* <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"/>
*>* <action application="export" data="dialed_extension=$1"/>
*>* <action application="set" data="call_timeout=30"/>
*>* <action application="set" data="hangup_after_bridge=true"/>
*>* <action application="set" data="continue_on_fail=true"/>
*>* <action application="hash"
data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
*>* <action application="hash"
data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
*>* <action application="set"
data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name}
var callgroup)}"/>
*>* <action application="hash"
data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/>
*>* <action application="hash"
data="insert/${domain_name}-last_dial_ext/global/${uuid}"/>
*>* <action application="hash"
data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
*>* <action application="bridge" data="user/$1@${domain_name}"/>
*>* <action application="answer"/>
*>*   </condition>
*>* </extension>
*> >* but the name generated had the same Guid for both uuid and
call_uuid (which suggests that it's the a-leg).
*> > >* My client issues a call to a number using embedded FreeSWITCH
as follows:
*> >* FreeSWITCH.Native.Api.Execute("pa", "call
sofia/gateway/<gateway>/<number> XML <caller Id> <caller name>")
*> >* and gets back a response like
*> >* SUCCESS:<call number>:<Guid>
*> >* 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?
*> >* Paul
*> >* From: FreeSWITCH-users <freeswitch-users-bounces at
lists.freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>> on
behalf of Vladyslav Zakhozhai <v.zakhozhai at gmail.com
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>>
*>* Sent: 14 August 2017 16:41:13
*>* To: FreeSWITCH Users Help
*>* Subject: Re: [Freeswitch-users] Channel variables on a-leg and b-leg
*>  >* Hi Paul,
*> >* ${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.
*> >* 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.
*> >* On Mon, Aug 14, 2017 at 5:01 PM, Paul Mateer <Paul.Mateer at
outlook.com <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
<mailto:Paul.Mateer at outlook.com
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>>>
wrote:
*>* Guys, I'm using the C# interface to FreeSWITCH to add the ability
to make and receive calls in an existing software application.
*> >* I want to record the conversations on the server, but I need to
be able to access the recording after the call is complete.
*>* The Call-ID value seemed the perfect solution to this and I added
the following action to my dialplan entry.
*> >* <action application="export"
data="execute_on_answer=record_session
$${base_dir}/recordings/${strftime(%Y.%m.%d_%H.%M.%S)}_${uuid}_${caller_id_number}.wav"/>
*> >* 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. I assume that this is
because the 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.
*> >* 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?
*> >* Thanks for any suggestions/assistance offered.
*> > > >* _________________________________________________________________________
*>* Professional FreeSWITCH Consulting Services:
*>* consulting at freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
<mailto:consulting at freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>>
*>* http://www.freeswitchsolutions.com
<http://www.freeswitchsolutions.com/>
<http://www.freeswitchsolutions.com/
<http://www.freeswitchsolutions.com/>>
*> >* Official FreeSWITCH Sites
*>* http://www.freeswitch.org <http://www.freeswitch.org/>
<http://www.freeswitch.org/ <http://www.freeswitch.org/>>
*>* http://confluence.freeswitch.org
<http://confluence.freeswitch.org/> <http://confluence.freeswitch.org/
<http://confluence.freeswitch.org/>>
*>* http://www.cluecon.com <http://www.cluecon.com/>
<http://www.cluecon.com/ <http://www.cluecon.com/>>
*> >* FreeSWITCH-users mailing list
*>* FreeSWITCH-users at lists.freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
<mailto:FreeSWITCH-users at lists.freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>>
*>* http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>>
*>* UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
<http://lists.freeswitch.org/mailman/options/freeswitch-users>
<http://lists.freeswitch.org/mailman/options/freeswitch-users
<http://lists.freeswitch.org/mailman/options/freeswitch-users>>
*>* http://www.freeswitch.org <http://www.freeswitch.org/>
<http://www.freeswitch.org/ <http://www.freeswitch.org/>>
*> > > >* --
*>* С уважением,
*>* Владислав Захожай
*> >* _________________________________________________________________________
*>* Professional FreeSWITCH Consulting Services:
*>* consulting at freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
*>* http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
*> >* Official FreeSWITCH Sites
*>* http://www.freeswitch.org <http://www.freeswitch.org/>
*>* http://confluence.freeswitch.org <http://confluence.freeswitch.org/>
*>* http://www.cluecon.com <http://www.cluecon.com/>
*> >* FreeSWITCH-users mailing list
*>* FreeSWITCH-users at lists.freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
*>* http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
*>* UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
<http://lists.freeswitch.org/mailman/options/freeswitch-users>
*>* http://www.freeswitch.org <http://www.freeswitch.org/>
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170814/5c471999/attachment-0001.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170815/3f4eb112/attachment.html>


More information about the FreeSWITCH-users mailing list