callerid format in outbound calls

200 views
Skip to first unread message

Marcin Muzylo

unread,
Jun 30, 2017, 11:11:22 AM6/30/17
to 2600hz-users
Hi everyone,

there is any way to format properly CallerID for outgoing calls ?

Example :
user external callerid is +123456789
one provider accepts callerid with + on front
second provider wants callerid without +  

how i can strip properly "+" on resource document ?

thanks in advance
Marcin

James Aimonetti

unread,
Jun 30, 2017, 12:00:13 PM6/30/17
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

For calls going to your carriers, adding formatters to the resource
documents is the way to go:

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

provider 2 could have something like:

{
"formatters": {
"caller_id_number":{
"regex":"^\\+?(\\d+)$"
}
}
}

This would capture all the digits and exclude any '+' if present.
- --
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+xZ5hP1H8lVIU1Mpr4k9cJWAFAllWdYMACgkQ1Mpr4k9c
JWDULwf+PmG3ppPd/TzOwlS0XcYdXI7UfWt06d8r5SAmvEVpcfDnKtdpP5AzsIN5
UDM5ZUgXfXpDQmRaKt52lRI7tFKn501la4cTU+1e0VHxaZw0Wmtg5WXldj8rZb/k
bzEAxUvMByjSjr0FhPa3PumHtvROrKrHeWy4phCQyqpi3N2LeLylT38aj2hYvWyB
z082knanCx7TI9AktxS8AQi1bEQVPuJhzNL2n1KHturBefmNJ3WdkLd8oh9gYT18
Tb+tj0OYonzIghdvhpFq/iqpMcP5+bHZc0bCRdMGQxleuTNzntRkp07NUK76ehv2
DIgumksXzmGsG/e95KZCraZUKXNxhQ==
=aSLB
-----END PGP SIGNATURE-----

Marcin Muzylo

unread,
Jun 30, 2017, 4:23:34 PM6/30/17
to 2600hz-users
thank you James but still not works (kazoo 4.1.16 ), here what i have:

user doc :

"caller_id": {
       "external": {
           "number": "+48123456789"
       },
       "internal": {
           "name": "marcin marcin",
           "number": "1000"
       }
   },



offnet resource :

  "format_from_uri": false,
   "formatters": {
       "caller_id_number": {
           "regex": "^\\+?(\\d+)$"
       }
   },
   "caller_id_options": {
       "type": "external"
   },
   "type": "local",

number manager :


 "did_pl": {
               "regex": "^\\+48(\\d{9})$",
               "friendly_name": "PL DID"
           },
           "did_pl_local": {
               "regex": "^(0[1-9]\\d{8})$",
               "friendly_name": "PL DID local"
           }
       },
       "converter": "regex",
       "e164_converters": {
           "^0(\\d{9})$": {
               "prefix": "+48"
           },
           "^\\+48(\\d{9})$": {
               "prefix": "+48"
           }
       },
       "reconcile_regex": "^(?:\\+48\\d{9})|(?:0\\d{9})$",

Marcin Muzylo

unread,
Jul 1, 2017, 2:46:16 PM7/1/17
to 2600hz-users
also under kazoo 4.0.61 with same result

Eamon

unread,
Jul 1, 2017, 2:46:16 PM7/1/17
to 2600hz-users
Hi James

tried the same or carrier dB and account db, no changes made to the cli. Is there another way of removing the + from the cli per carrier ?

James Aimonetti

unread,
Jul 2, 2017, 1:31:58 AM7/2/17
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Marcin,

I have looked at the code a bit more and realize the offnet request
being processed will have caller id in "Outbound-Caller-ID-Number" (or
"Emergency-Caller-ID-Number" if an emergency call).

Try changing the formatter to use "outbound_caller_id_number" instead; I
believe that should work for outbound.

Side note: I'm updating the docs for formatters to include the schemas
of the various AMQP requests that formatters would have access to when
running, which should hopefully make it more clear what fields should be
used. Should have a PR up in the next day or two.
>> sip:...@2600hz.com <javascript:>
>> tel:415.886.7905
>> irc:mc_ @ freenode
>> -----BEGIN PGP SIGNATURE-----
>>
>> iQEzBAEBCAAdFiEEvSh+xZ5hP1H8lVIU1Mpr4k9cJWAFAllWdYMACgkQ1Mpr4k9c
>> JWDULwf+PmG3ppPd/TzOwlS0XcYdXI7UfWt06d8r5SAmvEVpcfDnKtdpP5AzsIN5
>> UDM5ZUgXfXpDQmRaKt52lRI7tFKn501la4cTU+1e0VHxaZw0Wmtg5WXldj8rZb/k
>> bzEAxUvMByjSjr0FhPa3PumHtvROrKrHeWy4phCQyqpi3N2LeLylT38aj2hYvWyB
>> z082knanCx7TI9AktxS8AQi1bEQVPuJhzNL2n1KHturBefmNJ3WdkLd8oh9gYT18
>> Tb+tj0OYonzIghdvhpFq/iqpMcP5+bHZc0bCRdMGQxleuTNzntRkp07NUK76ehv2
>> DIgumksXzmGsG/e95KZCraZUKXNxhQ==
>> =aSLB
>> -----END PGP SIGNATURE-----
>>


- --
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+xZ5hP1H8lVIU1Mpr4k9cJWAFAllYhUUACgkQ1Mpr4k9c
JWBg9QgAly9hrCf45Q2GASO4C3ZmHN7Hrm2fRH3LYZbG6AHml/ZDk9tr3vR/cDtX
0dDuUJfust7UdDj2aS6DQYyax7KSZy/Yc2ntg5LfQ8b0O7qD4WBQXTkHAdqhY7vm
r55lA/tREasb4DLP6JMIg2JRL/K6CZMBMGkgo8xEK3WPCqnTKj+HJQaBX2Amu6Ww
Cq+re7qZ3yxmvX75Hlqcidf1iFYycaVz2KFAdnRducXfy1SXAVzpmfEXtbyQNLgN
6LPJ6Z7JwIrs8i2SvwyZ1oJOYd7lAFLAgJlK2txcToj5pIzrPlooLN8BFbo3R18R
5ejyXSoCbFY5//37A0b9w8OpBx0+YQ==
=OR15
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages