<div dir="ltr">Sounds like you want to check this result for truthiness: <a href="https://wiki.freeswitch.org/wiki/Mod_commands#user_exists">https://wiki.freeswitch.org/wiki/Mod_commands#user_exists</a><div><br></div><div>BTW export by default sets on both channels, so you don&#39;t need a SET and an EXPORT.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-Avi Marcus<br>BestFone</div></div></div>
<br><div class="gmail_quote">On Tue, Sep 8, 2015 at 12:19 PM, Michael Nielsen <span dir="ltr">&lt;<a href="mailto:mic.niel84@gmail.com" target="_blank">mic.niel84@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This is my dialplan so far, where I want to add this functionality (<a href="http://pastebin.com/k1hffPBp" target="_blank">http://pastebin.com/k1hffPBp</a>):<div><br></div><div><div>    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\+\d{3,20})$&quot;&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;dialed_number=$1&quot; inline=&quot;true&quot;/&gt;</div><div>      &lt;action application=&quot;export&quot; data=&quot;dialed_number=$1&quot; inline=&quot;true&quot;/&gt;</div><div>    &lt;/condition&gt;</div><div>    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\d{3,20})$&quot;&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;dialed_number=${country_code}$1&quot; inline=&quot;true&quot;/&gt;</div><div>      &lt;action application=&quot;export&quot; data=&quot;dialed_number=${country_code}$1&quot; inline=&quot;true&quot;/&gt;</div><div>    &lt;/condition&gt;</div><div>    &lt;condition field=&quot;${dialed_number}&quot; IF-USER-EXISTS&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;call_timeout=20&quot;/&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;</div><div>      &lt;action application=&quot;bridge&quot; data=&quot;user/${dialed_number}@${domain_name}&quot;/&gt;</div><div>      &lt;action application=&quot;answer&quot;/&gt;</div><div>      &lt;action application=&quot;sleep&quot; data=&quot;1000&quot;/&gt;</div><div>      &lt;action application=&quot;bridge&quot; data=&quot;loopback/app=voicemail:default ${domain_name} ${dialed_number}&quot;/&gt;</div><div>    &lt;/condition&gt;   </div><div>    &lt;condition field=&quot;${dialed_number}&quot; IF-USER-DO-NOT-EXISTS&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${effective_caller_id_number}&quot;/&gt;</div><div>      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=${effective_caller_id_number}&quot;/&gt;</div><div>      &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/pstn-outbound/${dialed_number}&quot;/&gt;</div><div>    &lt;/condition&gt;</div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 8, 2015 at 9:52 AM, Michael Nielsen <span dir="ltr">&lt;<a href="mailto:mic.niel84@gmail.com" target="_blank">mic.niel84@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I would like to the following:<div><br></div><div>&lt;condition IF-USER-EXISTS&gt;</div><div>&lt;/condition&gt;</div><div>&lt;condition IF-USER-DO-NOT-EXISTS&gt;</div><div>&lt;/condition&gt;</div><div><br></div><div>I&#39;m not able to check on regexp, as my user ID&#39;s match +44-12345678...</div><div>And I would like to do one thing if the user exists and otherwise route to my PSTN gateway.</div><div><br></div><div>I&#39;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.</div></div>
</blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<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.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.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.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div></div>