D
D
Dmitry Golov2021-03-12 14:33:20
Asterisk
Dmitry Golov, 2021-03-12 14:33:20

How to determine the CallerID of a subscriber for two related asterisks with the same numbering?

Given: 2 asterisks (freepbx) interconnected via IAX. Both asterisks have the same numbering (100...). The dialplan is configured in such a way that subscribers from one PBX can connect to subscribers of another PBX by dialing 501, 502, etc., that is, changing the first unit to 5.
Everything works great, except that subscribers are incorrectly defined, i.e. . the subscriber is determined based on the same number at the receiving PBX. If there is no such number, then everything is ok.
Example: ATS "A" 101 - Petya, ATS "B" 101 - Vasya. If Petya calls ATS "B", then he will be determined there, like Vasya.
How can I solve this problem. The main condition is that the numbering cannot be changed.

Trunk settings:
Outgoing:
username=***
host=***
type=peer
secret=***
qualify=yes
context=from-trunk
disallow=all
allow=alaw

Incoming:
host=***
type=user
secret=***
qualify=yes
context=from-internal
disallow=all
allow=alaw

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Golov, 2021-03-13
@Gold_68

Thanks to all! The solution was on the surface. It turned out to be my jamb: it was necessary to register CallerID in all extensions. As it turned out, where CallerID was not registered (there was only a name), it could be determined incorrectly with the configuration specified in the conditions. Now everything is ok.

R
Rsa97, 2021-03-12
@Rsa97

I don’t know how to do this in FreePBX, on pure Asterisk you can simply substitute the desired CALLERID before an outgoing call or after receiving an incoming call.
same => n,Set(CALLERID(num)=5${CALLERID(num):1})

A
Andrey Barbolin, 2021-03-12
@dronmaxman

Try using predial trunk hook
/etc/asterisk/extensions_override_freepbx.conf
[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(========Change CID for out calls ==== ========)
same => n,Set,(CALLERID(num)=5${CALLERID(num):-2})
same => n,MacroExit()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question