I
I
Igor Vedenov2021-09-09 08:51:10
Asterisk
Igor Vedenov, 2021-09-09 08:51:10

FreePBX how to detect local call?

Good. The essence of the problem is this. There is an organization with a park of about 50 external rooms. There was no automatic telephone exchange, everything was on copper. We set up a PBX, took these numbers via SIP from the provider, prescribed routes, set up internal calls. Everything is great except for one. Some people point blank do not want the internal dialing "I've been calling like this for 100 years and everything is fine." And the result is a picture that the call leaves the PBX to the provider and returns to us on another external number. How can you catch a call after outgoing routing, but before sending it to the trunk, and if we have a trunk with such a number, then do not send calls to the provider, but directly and make a short-short call.
Roughly the scheme I want
101 - external 332211
201 - external 554433
Number 101 calls to 554433, ATS, seeing that this number is serviced, calls immediately to 201, as when dialing 201 immediately.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2021-09-09
@Rsa97

I won’t tell you about FreePBX, but in pure Asterisk it’s done something like this:

[from-internal]
exten => 332211,1,goto(to-internal,101,1);
exten => 554433,1,goto(to-internal,201,1);

A
Andrey Barbolin, 2021-09-09
@dronmaxman

In general, this is an organizational issue and I would send all the users to hell and make them call the internal one, because. Because of such workarounds, then other rakes come out. Correct statistics on calls for example.
/etc/asterisk/extensions_custom.conf

[macro-dialout-trunk-predial-hook] ;; этот контекст выполняется перед набором в транка. Поумолчанию он не описан и его необходимо добавить в extensions_custom.conf.

;; Мне этот вариант не нравиться.
exten => 332211,1,Dial(SIP/101)
same => n,HangUp

;; Я бы делал вот так. Как по мне - это компромисный вариант.
exten => 554433,1,PlayBack(you-dialed-wrong-number&the-new-number-is)
same => n,SayDigits(102)
same => n,HangUp()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question