Number format

180 views
Skip to first unread message

ALMA

unread,
Jun 22, 2017, 10:44:29 AM6/22/17
to 2600hz-users
Hi,
when I receive a call from "+390901234567" (Italian number), Kazoo shows in my devices only "390901234567" without "+". I would like to add "+" or remove "39" (for Italy only).
In according with this doc https://github.com/2600hz/kazoo/blob/master/core/kazoo_endpoint/doc/formatters.md, I've added on account document this:

 "formatters": {
       "from": [
           {
               "regex": "^\\+?3?9?(\\d*)$",
               "prefix": "",
               "direction": "inbound"
           },
           {
               "regex": "^+(.*)$",
               "prefix": "+",
               "direction": "inbound"
           }
       ]
   }

but nothing changed. Also this is valid only for a single account. How can I set this format (without +39 for Italy and with + and prefix for all the rest) globally for all accounts without change all documents?

This is my number_manager document but I think that it is only for outbound.

{
   "_id": "number_manager",
   "default": {
       "classifiers": {
           "international": {
               "regex": "^(00|\\+)(\\d{4,})$",
               "friendly_name": "Internazionali",
               "pretty_print": "*"
           },
           "italian_fix": {
               "regex": "^(00|\\+)?(39)?(0)(\\d{4,})$",
               "friendly_name": "Italiani fissi",
               "pretty_print": "*"
           },
           "italian_mobile": {
               "regex": "^(00|\\+)?(39)?(3)(\\d{4,})$",
               "friendly_name": "Italiani mobili",
               "pretty_print": "*"
           },
           "unknown": {
               "regex": "^(.*)$",
               "friendly_name": "Altro",
               "pretty_print": "*"
           }
       },
       "e164_converters": {
           "^(.*)$": {
               "prefix": ""
           }
       },
       "reconcile_regex": "^\\+?[1-9]\\d{5,}$|^0\\d{5,}$|^00\\d{5,}$",
       "fetch_account_from_ports": true,
       "converter": "regex",
       "available_module_name": "knm_local",
       "features": {
           "allow": [
               "failover",
               "force_outbound",
               "prepend",
               "ringback"
           ]
       },
       "released_state": "available",
       "should_permanently_delete": false,
       "default_force_outbound": false,
       "force_local_outbound": true
   },
}

Eamon

unread,
Jun 23, 2017, 7:49:08 AM6/23/17
to 2600hz-users
you need to use e164 converters

       "e164_converters": {
           "^\\+?39?(\\d{10})$": {
               "prefix": "+39"
           },
        

ALMA

unread,
Jun 23, 2017, 4:39:05 PM6/23/17
to 2600hz-users
So  can e164_converters be used for inbound calls?

James Aimonetti

unread,
Jun 23, 2017, 5:08:06 PM6/23/17
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I'd suggest reading over this again:

https://docs.2600hz.com/dev/doc/internationalization/numbers/

e164_convertors aim to take whatever is received by Kazoo and convert it
to e164, so they are applied to inbound calls to normalize the inbound
number to e164.

Now, are you trying to get caller ID to be formatted differently? That
would be a good use of formatters put onto the device config (for
outbound to the device).

https://docs.2600hz.com/dev/core/kazoo_endpoint/doc/formatters/
- --
James Aimonetti

Lead Systems Architect
"If Dialyzer don't care, I don't care"
2600HzPDX | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEvSh+xZ5hP1H8lVIU1Mpr4k9cJWAFAllNgy4ACgkQ1Mpr4k9c
JWAt3wf/fdYpw782V4SJ4qedd8afWsL3LLmD9nkEbLpC4eWR8eJQUKxrLGe5W2Ko
/54dGK4OsOLMSsvnB+kgcK54hiX62enzMOIYKkKvrbaGDSrMCTAd+pejnDnqmVlJ
nPzjpM4LLxfOETD5/H/kVER9Wpc4AraXV7FLO3hfwONxl4RU7oM1h1l1JrGb+1jS
RtaF+9VAUwzQV3+AYTuKn1x1cmj4trBM5xgd6PCX2GZjRVNQ951QZQEdQ6/fsF+0
AAqT5T92/fQp3UbUmnMAiDbkiVctQSRBaGH/0C37O2Cx1G3wz3xUkm4ffMqMM+Mh
pJQwj70T3j1x8ywW80K3f161ImcViQ==
=xYgH
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages