Convert / modify incoming DID possible ?

Status
Not open for further replies.

MrWeb

New Member
Mar 8, 2021
23
1
3
49
Hi @ all,
i use FusionPBX Version 5.0.9 in my office.

All is working fine, but i have one little problem.
I use yealink phones, and i generate remote phonebooks for the users.
All that is also working, but....
The incoming call's have different number formats...
sometimes a number comes in with
+4912345678
or
0123 45678
also possible is
0049123 45678

In the phonebooks i want only one notation, not all double...
When in the phonebook is the number +4912345678 and the call
comes in with 012345678 the name is not displayed :-(
So i want to modify always the incoming number (DID?)
to the +49... notation.
Is that possible, and can someone tell me how?
Or is somewhere a howto ?

I hope someone have the needed information for me...

Best regards and i wish all a nice weekend,
MrWeb
 

mcs3ss2

Active Member
Sep 8, 2020
259
28
28
AU
I believe there is an app called Number Translation but I donot know how to use it :-(
 

MrWeb

New Member
Mar 8, 2021
23
1
3
49
Thanks for your answers.
I found this module and played with it, but without a reslut.
Now i found, that i need to compile and activate the module first.
Now it is active, and i have added my rules for the translations.
But how i can activate these rules for the incoming calls and numbers ?
 

hfoster

Active Member
Jan 28, 2019
677
80
28
34
To use mod-translate to modify inbound calls before they hit the dialplan the following setting for the SIP-profile must be modified:

dialplan “XML” -> dialplan “Translate,XML”
With FreeSwitch 1.8.x it is now possible to specify the translation profile to be used: dialplan “XML” -> dialplan “Translate:my_profile1,XML”

1680275497337.png
 

MrWeb

New Member
Mar 8, 2021
23
1
3
49
Thanks, now i can see in the log file,
that mod_translate do something, but i get the error:
mod_translate.c:132 can't find key for profile matching [DE]

Any idea how i can solve that ?
I changed in the extern sip profile the
dialplan XML to
dialplan Translate,XML
Under Number Translatios i have only my new rule active with the expression:
^0(\d+)$ +49$1

I have also a Name and description field. But i can not set a profile name here :-(

Which step do i not see here ?
 

hfoster

Active Member
Jan 28, 2019
677
80
28
34
I'm pretty sure the name is the 'profile' name. I've only used it in FreeSwitch myself. So if I created a rule called GB:

Translate:GB,XML
 

MrWeb

New Member
Mar 8, 2021
23
1
3
49
Yes thanks, i found it out.
In the fusionpbx gui Advanced->Number Translations
the name of the ruleset is the profile name.
Translate:NAME,XML
is right here.
But i get always the error
mod_translate.c:132 can't find key for profile matching [DE_to_e164]
 

MrWeb

New Member
Mar 8, 2021
23
1
3
49
DE_to_e164.PNG

That is my rule,
i added the
dialplan Transfer:DE_to_e164, XML

and i reboot the server.
But always the same errors (reverse order, newest is up):


Code:
2023-03-31 19:00:40.353984 99.10% [INFO] mod_translate.c:308 Profile: [DE_to_e164], Translated Destination: [(null)], Translated CID: [(null)], Translated ANI: [(null)]
2023-03-31 19:00:40.353984 99.10% [NOTICE] mod_translate.c:132 can't find key for profile matching [DE_to_e164]
2023-03-31 19:00:40.353984 99.10% [DEBUG] mod_translate.c:128 translating [0123456789] against [DE_to_e164] profile
2023-03-31 19:00:40.353984 99.10% [NOTICE] mod_translate.c:132 can't find key for profile matching [DE_to_e164]
2023-03-31 19:00:40.353984 99.10% [DEBUG] mod_translate.c:128 translating [0123456789] against [DE_to_e164] profile
2023-03-31 19:00:40.353984 99.10% [NOTICE] mod_translate.c:132 can't find key for profile matching [DE_to_e164]
2023-03-31 19:00:40.353984 99.10% [DEBUG] mod_translate.c:128 translating [0611223344] against [DE_to_e164] profile
2023-03-31 19:00:40.353984 99.10% [DEBUG] mod_translate.c:279 using translate:<profile> [DE_to_e164] for translate profile
2023-03-31 19:00:40.353984 99.10% [INFO] mod_translate.c:273 Processing 0123456789->0611223344 in translate
 

MrWeb

New Member
Mar 8, 2021
23
1
3
49
I found the solution...

It is needed to clean the cache dir
/var/cache/fusionpbx

After a reboot the files are generated new and then it works.

Thanks for all the help :)
 

hfoster

Active Member
Jan 28, 2019
677
80
28
34
Makes sense, I was looking through the source code and that definitely does work so i was confused. I always forget about that cache.
 
Status
Not open for further replies.