Number Translation

Status
Not open for further replies.

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,043
565
113
Nice snippet from MafooUK over on IRC
Code:
<dialplan>
   <extension name="e164_to_GB" continue="true">
        <action application="set" data="ignore_display_updates=true" />
        <action application="translate" data="${destination_number} e164_to_GB" />
        <action application="translate" data="${caller_id_number} e164_to_GB" />
    </extension>
</dialplan>
<config>
  <configuration name="translate.conf" description="Number Translation Rules">
    <profiles>
      <profile name="GB_to_e164">
        <rule regex="^\+(\d+)$" replace="$1"/>
        <rule regex="^00(\d+)$" replace="$1"/>
        <rule regex="^0([1-9]\d+)$" replace="44$1"/>
        <rule regex="^(\d+)$" replace="$1"/>
      </profile>
      <profile name="e164_to_GB">
        <rule regex="^44(\d{3,6})$" replace="$1"/>
        <rule regex="^44(\d+)$" replace="0$1"/>
        <rule regex="^(\d+)$" replace="00$1"/>
        <rule regex="^\+(\d+)$" replace="00$1"/>
      </profile>
    </profiles>
  </configuration>
</config>
 

inam

New Member
Mar 9, 2017
4
0
1
37
Hello,

Can you tell me where do I add this code in fusionpbx please.

Thanks
Inam
 

TheOperator

Member
Nov 30, 2016
39
13
8
Bavaria, Germany
Hi Inam,

to activate mod-translate you have to do the following:
  1. Install the package "freeswitch-mod-translate" via aptitude/apt-get etc.
  2. Configure the module to your likes. The configuration file "translate.conf.xml" can be found in /etc/freeswitch/autoload_configs
  3. Activate the module in FusionPBX Advanced -> Modules in the Applications section
The documentation for mod-translate can be found under https://freeswitch.org/confluence/display/FREESWITCH/mod_translate

Regards,
Olaf
 
  • Like
Reactions: DigitalDaz

MafooUK

New Member
Feb 10, 2017
1
1
3
This has now been integrated into master (4.3 at the time of writing) as Advanced > Number Translation to manage teh profiles
you still need to create the dialplan entries or adjust your dialplan to run though it first
 
  • Like
Reactions: simcard
Status
Not open for further replies.