<div dir="ltr">This is my dialplan so far, where I want to add this functionality (<a href="http://pastebin.com/k1hffPBp">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="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>