S
S
SteepNET2021-10-22 17:33:32
Asterisk
SteepNET, 2021-10-22 17:33:32

Asterisk outbound routing\hook?

Good afternoon! There is Asterisk 13 and FreePBX 14, routing is configured, prefixes, directions, everything works fine. But in Dial Patterns, static routes are registered and do not take into account MNP numbers, those who switched with saving the number. The idea came to use a third-party server and by the kitchen I find out if the number belongs, but how to resolve it further in FreePBX \ Asterisk, the thought comes
[macro-dialout-trunk]
include => macro-dialout-trunk-custom

Someone might have done this or knows exemplary implementation, how to use exactly the directions that the FreePBX GUI use?
I receive a response from the service in JSON in the following form
: "operator": "Beeline", "operatorID": "2952" well, etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Barbolin, 2021-10-23
@dronmaxman

You can try like this.
Add [macro-dialout-trunk-predial-hook] to /etc/asterisk/extensions_override_freepbx.conf, it is executed before dialing into any trunk, you will get your JSON in it.
Then, based on the information from JSON, you will add a prefix to the number. By the way, you can use operatorID as a prefix.
2952 - Beeline operator
2953 - MTS
Then add these prefixes to the routes.
2952ХХХХХХХ.
2953ХХХХХХХ.

G
Gansterito, 2021-10-25
@Gansterito

Since a third-party online service is used, there are risks of its short-term unavailability with all the consequences. Therefore, I can suggest making a FastAGI server (local), which will process all calls, access external services, take into account their unavailability or return an error. As a result, FastAGI should return a command like Goto(dial_vimpelcom,${EXTEN},1), Goto(dial_rostelecom,${EXTEN},1), etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question