Georg,<br><br>If you just want the phone number w/o the international prefix then it&#39;s better to capture that correctly the first time:<br>&lt;condition field=&quot;destination_number&quot; expression=&quot;^(49)?(123456789)$&quot;&gt;<br>
The value you want is now in $2, and if it&#39;s international then you&#39;ll have &quot;49&quot; in $1. However, you cannot use $1 or  $2 in another condition. You&#39;ll need to store them before you do anything else:<br>
<br>&lt;extension name=&quot;Dispo Intern&quot; continue=&quot;true&quot;&gt;<br> 
&lt;condition field=&quot;destination_number&quot; expression=&quot;^(49)?(123456789)$&quot;&gt;<br>    &lt;action application=&quot;set&quot; data=&quot;international=$1&quot; inline=&quot;true&quot;/&gt;<br>    &lt;action application=&quot;set&quot; data=&quot;dialed_number=$2&quot; inline=&quot;true&quot;/&gt;<br>
  &lt;/condition&gt;<br><br>  &lt;condition field=&quot;${international}&quot; data=&quot;^49$&quot;&gt;<br>    &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=0${dialed_number}&quot;/&gt;<br>
    &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=_undef_&quot;/&gt;<br>    &lt;anti-action application=&quot;set&quot; data=&quot;effective_caller_id_number=${dialed_number}&quot;/&gt;<br>  &lt;/condition&gt;<br>
<br>&lt;/extension&gt;<br>
<br>Try that. Standard disclaimer applies: I did that off the top of my head, so if it doesn&#39;t work the first time please test and tinker a bit before you report back. :)<br><br>-MC<br><br><div class="gmail_quote">On Tue, Sep 18, 2012 at 1:53 PM,  <span dir="ltr">&lt;<a href="mailto:georg@riseup.net" target="_blank">georg@riseup.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
My provider is sending me the phone numbers in the E.164 (I guess) format.<br>
I would like to remove the international prefix (on local fixed line and<br>
local mobile calls at least), and add a leading zero. I know how to add<br>
digits, but I&#39;ve got problems to remove digits.<br>
<br>
My dialplan at the moment looks like this:<br>
<br>
&lt;extension name=&quot;Dispo Intern&quot; continue=&quot;true&quot;&gt;<br>
 &lt;condition field=&quot;destination_number&quot; expression=&quot;^(123456789)$&quot;&gt;<br>
  &lt;regex field=&quot;caller_id_number&quot; expression=&quot;^49(\d+)$2&quot;/&gt;<br>
  &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=0$2&quot;/&gt;<br>
  &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=_undef_&quot;/&gt;<br>
  &lt;anti action application=&quot;set&quot;<br>
data=&quot;effective_caller_id_number=${original_caller_id_number}&quot;/&gt;<br>
 &lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
What I&#39;m trying to do:<br>
- Check if the call is a &quot;local&quot; one<br>
- If yes, alter the caller id<br>
- I thought, I&#39;m able to save the stripped caller id in $2, and use it<br>
again in the next line; this is not true, or at least not in the way I did<br>
this<br>
- It seems that $2 is &quot;empty&quot;, because the altered caller id is just 0<br>
<br>
Could someone point me into the right direction?<br>
<br>
Thanks in advance,<br>
Georg<br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" 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" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>