[Freeswitch-users] Condition on if user exists.

Michael Nielsen mic.niel84 at gmail.com
Tue Sep 8 13:19:47 MSD 2015

This is my dialplan so far, where I want to add this functionality (

    <condition field="destination_number" expression="^(\+\d{3,20})$">
      <action application="set" data="dialed_number=$1" inline="true"/>
      <action application="export" data="dialed_number=$1" inline="true"/>
    <condition field="destination_number" expression="^(\d{3,20})$">
      <action application="set" data="dialed_number=${country_code}$1"
      <action application="export" data="dialed_number=${country_code}$1"
    <condition field="${dialed_number}" IF-USER-EXISTS>
      <action application="set" data="call_timeout=20"/>
      <action application="set" data="hangup_after_bridge=true"/>
      <action application="set" data="continue_on_fail=true"/>
      <action application="bridge" data="user/${dialed_number}@
      <action application="answer"/>
      <action application="sleep" data="1000"/>
      <action application="bridge" data="loopback/app=voicemail:default
${domain_name} ${dialed_number}"/>
    <condition field="${dialed_number}" IF-USER-DO-NOT-EXISTS>
      <action application="set"
      <action application="set"
      <action application="bridge"

On Tue, Sep 8, 2015 at 9:52 AM, Michael Nielsen <mic.niel84 at gmail.com>

> I would like to the following:
> <condition IF-USER-EXISTS>
> </condition>
> <condition IF-USER-DO-NOT-EXISTS>
> </condition>
> I'm not able to check on regexp, as my user ID's match +44-12345678...
> And I would like to do one thing if the user exists and otherwise route to
> my PSTN gateway.
> I've tried to just use bridge with both local routing and PSTN calls, but
> then I try to call my PSTN everytime I call local users.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150908/ab3d43ac/attachment-0001.html 

Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list