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

Vladyslav Zakhozhai v.zakhozhai at gmail.com
Thu Aug 17 16:24:29 UTC 2017


Paul, what do you mean about "pa call"? I did not understand you completely.

Use case is the following:
1. record session to file ${uuid} (this is uuid of a-leg)
2. watch event CHANNEL_HANGUP_COMPLETE and get all you need

Or even better
1. set record_name=${uuid}
2. record session ${record_name}
3. watch event CHANNEL_HANGUP_COMPLETE and get all you need (e.g.
variable_record_name)

Be aware of.... you'll get 2 CHANNEL_HANGUP_COMPLETE events in case of
successful call. One event for a-leg, other one for b-leg. Possibly you
will not find variable_record_name on b-leg but you can just ignore it if
you do not need b-leg's event.


On Tue, Aug 15, 2017 at 11:44 AM, Paul Mateer <Paul.Mateer at outlook.com>
wrote:

> I don't really mind what uuid is used.
>
> What I'm really interested in is for the client to be able to identify the
> file which the server has generated in it's recording folder so that it
> (the client) can make a call to a different service running on the same
> server to process the file.
>
> The channel or call uuid seemed like a good way to uniquely identity the
> file but the guid which is returned as the response to a “pa call” command
> (and which I had assumed was one of these two) doesn't appear to match the
> uuid used by the server. It’s being generated by the FreeSWITCH libraries
> on the client rather than being returned from the server as far as I can
> tell.
>
>
> ------------------------------
> *From:* FreeSWITCH-users <freeswitch-users-bounces at lists.freeswitch.org>
> on behalf of Michael Jerris <mike at jerris.com>
> *Sent:* 14 August 2017 22:27:11
> *To:* FreeSWITCH Users Help
> *Subject:* Re: [Freeswitch-users] Channel variables on a-leg and b-leg
>
> 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> 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>
> on behalf of Vladyslav Zakhozhai <v.zakhozhai at gmail.com>
> *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>
> 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://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
>
> --
> С уважением,
> Владислав Захожай
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
С уважением,
Владислав Захожай
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170817/3f7a082f/attachment-0001.html>


More information about the FreeSWITCH-users mailing list