Sorry to bother you with such a simple question.
I can’t solve the problem for a long time.
There is a script that looks at the called subscriber when calling and checks if his line is busy.
If busy, it plays an audio message and continues the call.
In this case, the caller who is being called can receive a call while playing an audio audio file.
The audio message says “The subscriber is talking on another line, please wait or call back later”
The script put in the extensions_custom.conf file
Path: /etc/asterisk/extensions_custom.conf
Here is the script:
[from-internal-custom]
include => macro-dialout-one-predial-hook
(custom/abonent_zanyat_MTS2 - this is an audio file that is played in wav format)
Сan I understand why it doesn’t work?What am I doing wrong?
Maybe you need to add something else somewhere?
I will be very grateful if you help with this problem.
I would point out that the intended operation of this code is subject to race conditions, in particular, the called extension could go busy between the read of DEVICESTATE and the point when the call reaches it, so you could still end up with the default busy line behaviour. Also, the line could become free whilst the message is playing.
I don’t understand this sentence.
Could you please explain the problem in the use of the system that makes you think this code is necessary.
I need that If subscriber number 1 is already talking to subscriber 2, and subscriber number 3 is calling him.
Then the subscriber number 3 will hear “the subscriber is talking on another line” and the 3rd subscriber was put on hold (that is, the call continues). This means that subscriber number 1 can put subscriber number 2 on hold at this time and accept a call from subscriber number 3.
There is a similar function in asterisk, it is called call waiting, but with it, subscriber number 3 simply hears long beeps and does not understand if subscriber 1 is busy or ignores and there are unnecessary problems at work.
According to the call logs, everything writes like a normal call, as if it doesn’t even touch extensions_custom.conf.
But if you register this script in the extensions.custom file (which says that it cannot be edited) in the [macro-dialout-one-predial-hook] section it seems to work, but the extensions_custom.conf file is then overwritten to the initial view.
If you want to use the context macro-dialout-one-predial-hook then just create it in the file extensions_custom.conf. There is no need to touch any other files.
extensions.conf should include an include line that leads to extensions_custom.conf, directly or indirectly,
Note that no files are read during a call; they are all read during a configuration reload. The included files are substituted into the top level file at the point where their respective include is read.
You don’t have to do anything about the spelling , it is already in /etc/asterisk/extensions.conf (spelled correctly) you just need to put your [macro-dialout-one-predial-hook] in /etc/asterisk/extensions_custom.conf and reload either specifically the dialplan or more generally fwconsole
Get rid of the include and from-internal custom context. Did you reload the dialplan after the edit? Have you reviewed the link above about using hooks, everything you need to know is all there.