[Freeswitch-users] Logical AND + NOT
Michael Collins
msc at freeswitch.org
Tue Feb 26 20:28:26 MSK 2013
<!-- eavesdrop -->
<extension name="record_3..16_digits" continue="true">
<condition field="destination_number" expression="^399|400$"
break="never">
<action application="set" data="record_me=false" inline="true"/>
<anti-action application="set" data="record_me=true" inline="true"/>
</condition>
<condition field="${is_already_recording}" expression="^$"/>
<condition field="${record_me}" expression="^true$"/>
<condition field="destination_number" expression="^(\d{3,16})$">
<action application="set" data="RECORD_TITLE=Recording ${caller_id_name}
${caller_id_number} to ${destination_number} at ${strftime(%Y-%m-%d
%H:%M)}"/>
<action application="set" data="RECORD_STEREO=true"/>
<action application="export" data="ignore_early_media=true"/>
<action application="set" data="media_bug_answer_req=true"/>
<action application="record_session" data="$${base_dir}/recordings/
archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${caller_id_name}_${
caller_id_number}_2_${destination_number}.mp3"/>
<action application="export" data="is_already_recording=true"/>
</condition>
</extension>
try that and report back...
-MC
On Tue, Feb 26, 2013 at 12:01 AM, Dmitriy Shumaev <pm_zefman_r at mail.ru>wrote:
> Hi
>
> I want to record all sessions, except calls to group numbers and to IVR.
> So I need something like:
> <!-- eavesdrop -->
> <extension name="record_3..16_digits" continue="true">
> <condition field="${is_already_recording}" expression="^$"/>
> <condition field="destination_number" expression!="^(400)$"/> <!--NOT
> EQUAL--><!-- IVR -->
> <condition field="destination_number" expression!="^(399)$"/> <!--NOT
> EQUAL--><!-- Group number -->
> <condition field="destination_number" expression="^(\d{3,16})$">
> <action application="set" data="RECORD_TITLE=Recording ${caller_id_name}
> ${caller_id_number} to ${destination_number} at ${strftime(%Y-%m-%d
> %H:%M)}"/>
> <action application="set" data="RECORD_STEREO=true"/>
> <action application="export" data="ignore_early_media=true"/>
> <action application="set" data="media_bug_answer_req=true"/>
> <action application="record_session"
> data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${caller_id_name}_${caller_id_number}_2_${destination_number}.mp3"/>
> <action application="export" data="is_already_recording=true"/>
> </condition>
> </extension>
> . But the syntax of condition does not allow the operator "not equal" or
> "!=". What should I do?
>
>
> With best regards, Shumaev DA, KBR Ltd.
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.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
>
>
--
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130226/39ee3b01/attachment-0001.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list