Changing the CID on the fly / Изменение CID "на лету"

Hello
Cube is dying. It is necessary to intercept routing from him for a while and wait for the launch of the Flat solution in the office.

It turns out a chain:
Provider < - > FreePBX < - >CUCM

The provider provides 2 pools of 300 numbers (11 2100-2399 and 23 4500-4799).
There are no problems with an incoming call. I accept the trunk without registration, remove 11 or 23 and transfer it to CUCM (a four-digit number inside).

But the provider needs to specify the CID not XXX, but prefix 12345 XXX XX
How can this be implemented for calls from CUCM?


Здравствуйте
Умирает cube. Необходимо на время перехватить маршрутизацию с него и дождаться запуска в конторе решения от Flat.

Получается цепочка:
Провайдер < - > FreePBX < - >CUCM

Провайдер отдает 2 пула по 300 номеров(11 2100-2399 и 23 4500-4799).
Со входящим звонком проблем нет. Принимаю транком без регистрации, убираю 11 или 23 и отдаю в CUCM(внутри четырехзначные номера).

А вот провайдеру нужно отдать CID не XXXX, а поставить префикс 444411XXXX или 444423XXXX
Как это можно реализовать?

Not tested, but I believe this should be fairly close.
Add this to /etc/asterisk/extensions_custom.conf

[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${CALLERID(num):0:1}" = "4"]?p23)
exten => s,n,Set(CALLERID(num)=444411${CALLERID(num)})
exten => s,n,MacroExit()
exten => s,n(p23),Set(CALLERID(num)=444423${CALLERID(num)})
exten => s,n,MacroExit()

Reload Asterisk, test.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.