[Freeswitch-users] Strip digits from incoming caller id

georg at riseup.net georg at riseup.net
Wed Sep 19 00:53:39 MSD 2012


Hi all,

My provider is sending me the phone numbers in the E.164 (I guess) format.
I would like to remove the international prefix (on local fixed line and
local mobile calls at least), and add a leading zero. I know how to add
digits, but I've got problems to remove digits.

My dialplan at the moment looks like this:

<extension name="Dispo Intern" continue="true">
 <condition field="destination_number" expression="^(123456789)$">
  <regex field="caller_id_number" expression="^49(\d+)$2"/>
  <action application="set" data="effective_caller_id_number=0$2"/>
  <action application="set" data="effective_caller_id_name=_undef_"/>
  <anti action application="set"
data="effective_caller_id_number=${original_caller_id_number}"/>
 </condition>
</extension>

What I'm trying to do:
- Check if the call is a "local" one
- If yes, alter the caller id
- I thought, I'm able to save the stripped caller id in $2, and use it
again in the next line; this is not true, or at least not in the way I did
this
- It seems that $2 is "empty", because the altered caller id is just 0

Could someone point me into the right direction?

Thanks in advance,
Georg




Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list