0
votes

Please help in the problem that I encountered recently.

When implementing the function of informing the caller "User talking on the first line Please wait or call back later." With the function "Call Waiting" in the Asterisk I use this macro:

extensions_custom.conf

[from-internal-custom]
exten => _XXX,1,Macro(check-number,${EXTEN})
include => macro-check-number

[macro-check-number]
exten => s,1,NoOp(Enter in macro-check-number)
exten => s,n,Set(devst=${DEVICE_STATE(SIP/${ARG1})})
exten => s,n,ExecIf($["${devst}" = "INUSE"]?Playback(ml))
exten => s,n,NoOp(Exit from macro-check-number)

ml - filename for playback

And this feature works!

But the macro works for the entire Asterisk, this queue calls, group calls - and that is the problem.

I have an idea - a group of calls and queue calls to assign numbers four-digit extensions, for example: 2222 - but are not you should not be, it is a false solution to the problem, because of which in the future could be a problem!

Maybe somebody faced a similar problem?

3
This is very dependent on your dialplan. You could set a variable when entering the dialplan to activate functions like this, while the variable is unset when entering group or queue context.Roland Rusch
Thanks, I was thinking about this option, but unfortunately, it is possible so that I have little experience in dealing with macro - I have not found a solution. I would be grateful for the help!Danila Abramenko

3 Answers

1
votes

You don't need to include section in the from-internal-custom context as extensions_custom.conf file is included in the dial plan.

You need to change the pattern of extension:

[from-internal-custom]
exten => _99XXX,1,Macro(check-number,${EXTEN:2})

[macro-check-number]
exten => s,1,NoOp(Enter in macro-check-number)
exten => s,n,Set(devst=${DEVICE_STATE(SIP/${ARG1})})
exten => s,n,ExecIf($["${devst}" = "INUSE"]?Playback(ml))
exten => s,n,NoOp(Exit from macro-check-number)


0
votes

You have analyze environment of call based on your dialplan.

For examples of such dialplan you can see recoring macro in freepbx project. However simplest way is just use different context for ringgroup/queues and direct diallling.

0
votes

The problem was solved in the circuit. Since we serve telephony server with no more than 250 members - it was decided to create a four-digit number for the groups and queues.