Automated generated calls that playback a recorded voice

Hello,
First of all, i want to show my hardware, my achievements, my goal and then my questions.

HARDWARE
I have this hardware:
1-. Asterisk Server 18.10.0
2-. PSTN Gateway brand Planet, model VIP-480
3-. 4g LTE Router (Huawei B311) with telephone jack, connected to FXO port from my PSTN Gateway.

ACHIEVEMENTS
I can do the following things:
1-. I can to generate a call using Node-RED and Ami Originate command between a local extension and a dialplan number that playback my recordings.
My dialplan its like that:
exten => 201,1,NoOp(Alarm Voice)
same => 2,Playback(alarm_siteX)
same => 3,Playback(alarm_siteX)
same => 4,Playback(alarm_siteX)
same => 5,Hangup()

My AMI command in node-red it’s like that:
action: Originate
channel: SIP/ext104
context: my-context
exten: 201
priority: 1

SIP/ext104 it’s a local extension (my pc with zoiper) that recieves a call with a recorded voice saying “security alert in X site”

2-. I can to make outside calls using my PSTN gateway.

I achieve this using two method, one more elegant
2.1-. I can to make a Zoiper call to an extension configured in the Gateway FXO Port and then, i need to press the Zoiper dialpad to make outside calls.
2.2-. I can to make a direct call to outside from Zoiper, using “D” argument in Dial command in my dialplan, something like that:

exten => 401,1,NoOp(Outside calls using LTE Router)
same => n,Dial(SIP/401,1,D(912345678)

so, if i call to 401 using my zoiper application, i can to call to real number 912345678 (example number from my country)

GOAL
I need to make the following scenario:
1-. Node-Red generates call to a “user-configurable” number that when the user answers, play a record voice saying “Security Alert in X place”. The place and the user configurable number may change in nodered

QUESTION
¿What way do you recommend to achieve that? my PSTN gateway needs to recieve DTMF tones to make the call and i cant to make an outside call using Originate command in Node-Red that calls an “fake extension” from my dialplan and then stablish the call to SIP extension linked to FXO Port from my gateway and send DTMF Tones with the user-configurable number.
I tried several ways but i cant to do it. I’m beginner in Asterisk so all the comments and opinions are apreciated.

You could use the local channel to perform the dialing, instead of dialing SIP/ext104

The you could use your dialplan almost as is.

action: Originate
channel: Local/401912345678@outbound-call
context: my-context
exten: 201
priority: 1

Your dialplan would be something like this

[outbound-call]
exten => _401.,1,NoOp(Outside calls using LTE Router)
same => n,Dial(SIP/401,1,D(${EXTEN:3})

That way you can vary the number when sending the AMI action, instead of having to handle it in the dialplan.

1 Like

it works flawlessly, very grateful. I didn’t know about local channels, i need to learn more about Asterisk. Thank you.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.