Georg,<br><br>If you just want the phone number w/o the international prefix then it's better to capture that correctly the first time:<br><condition field="destination_number" expression="^(49)?(123456789)$"><br>
The value you want is now in $2, and if it's international then you'll have "49" in $1. However, you cannot use $1 or $2 in another condition. You'll need to store them before you do anything else:<br>
<br><extension name="Dispo Intern" continue="true"><br>
<condition field="destination_number" expression="^(49)?(123456789)$"><br> <action application="set" data="international=$1" inline="true"/><br> <action application="set" data="dialed_number=$2" inline="true"/><br>
</condition><br><br> <condition field="${international}" data="^49$"><br> <action application="set" data="effective_caller_id_number=0${dialed_number}"/><br>
<action application="set" data="effective_caller_id_name=_undef_"/><br> <anti-action application="set" data="effective_caller_id_number=${dialed_number}"/><br> </condition><br>
<br></extension><br>
<br>Try that. Standard disclaimer applies: I did that off the top of my head, so if it doesn'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"><<a href="mailto:georg@riseup.net" target="_blank">georg@riseup.net</a>></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've got problems to remove digits.<br>
<br>
My dialplan at the moment looks like this:<br>
<br>
<extension name="Dispo Intern" continue="true"><br>
<condition field="destination_number" expression="^(123456789)$"><br>
<regex field="caller_id_number" expression="^49(\d+)$2"/><br>
<action application="set" data="effective_caller_id_number=0$2"/><br>
<action application="set" data="effective_caller_id_name=_undef_"/><br>
<anti action application="set"<br>
data="effective_caller_id_number=${original_caller_id_number}"/><br>
</condition><br>
</extension><br>
<br>
What I'm trying to do:<br>
- Check if the call is a "local" one<br>
- If yes, alter the caller id<br>
- I thought, I'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 "empty", 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>