Dialplan help for incoming call


(Australia) #1

Hi, I am using the allowlist module to whitelist phonebook entries.
If the allowlist is false I have it setup to a custom destination that points to extension.conf.
Here is the dialplan for it.
Iam a newbie to DP so think its something easy.
After dial ext 14, Answering ext, the plan stops. logs below.
I think i need something after dial to continue DP??

[allowlist]
exten=> 14,1,dial(sip/14)
same => n,Answer()
same => n,WaitForNoise(500)
same => n,WaitForSilence(500,[500])
exten => s,1,GotoIf($["${WAITSTATUS}" = “Silence”]?dial14)
same => n,Goto(xxxxxx).

app_dial.c: SIP/14-000000c2 answered SIP/FB trunk 625-000000c1

490[2021-05-01 08:23:05] VERBOSE[15398][C-00000092] bridge_channel.c: Channel SIP/14-000000c2 joined ‘simple_bridge’ basic-bridge <3667da55-8be6-4579-b234-84562635da11>

[allowlist]
exten=> 14,1,dial(sip/14)
same => n,Answer()
same => n,WaitForNoise(500)
same => n,WaitForSilence(500,[500])
exten => s,1,GotoIf($["${WAITSTATUS}" = “Silence”]?dial14)
same => n,Goto(xxxxxx).

Cheers

Asterisk 16.15.0


(Australia) #2

I have found I need to use dial macro to this i think to. I can also use Go Sub

I have tried several things none are working…
exten => n,Dial(SIP/14,60,M(macro-answered))

Any advice on where to look next appreciated


(Lorne Gaetz) #3

I can’t figure out your goal. What do you want to happen to calls that fail the allowlist?


(Australia) #4

For calls that fail the allowlist i want to detect if they are spam calls or real calls. I read in another post that wait for noise/silence is the way to do it?
If real caller ring ring ext 14, if spammer go to custom destination.

typring this i realise i have it back the front, i need the dial 14 after doing the wait for noise/silence…

So i can get ext 14 to ring id allowlist is false, and when call is answered log files show a bridge connection and thats where the DP stops.

So more like this,
[allowlist]
exten => 14,1,Answer
same => n,WaitForNoise(500)
same => n,WaitForSilence(500)
exten => s,1,GotoIf($["${WAITSTATUS}" = “Silence”]?(dial/sip14))
same => n,Goto(custom dest)

Thanks.


(Australia) #5

Anyone able to help me out…


(Mitch Mitchell) #6

I would not do it that way as you really cannot tell if what you are hearing is a robocall announcer or a person.

Your dialplan doesn’t appear to be defined correctly for what you describe. The the first line will match extension number 14 but if I understand your intention you haven’t yet made a decision at that point whether to send the call to extension 14 yet.

I’d really recommend not writing dialplan rules to test for spam calls, I have an IVR that asks the caller to press 1 if they want my wife, press 2 if they want me, and hang on the line to leave a message.

No spammers have gotten past that and none of the robocallers ever leave a message either so its been pretty effective for us.