0

I'm experimenting with the ARI interface in Asterisk (v15.5). I've managed to placing and manage outbound calls relatively well, and I'm now trying to tackle inbound calls.

I don't have any dialplan to speak of on my test server; it hasn't been needed: I just connect via ARI, Originate channels, and bridge them together. However, trying to send an inbound call to the server gives me an error

chan_sip.c:26513 handle_request_invite: Call from 'upstreamserver' (192.168.x.x:5060) to extension '12345' rejected because extension not found in context 'default'.

Fair enough - Asterisk doesn't know about extension 12345 or what to do with it. I could, of course, add this into extensions.conf, put the extension into stasis and let my application deal with this: however, this has two downsides:

  • We have potentially hundreds of inbound numbers, and we'd need to keep the dialplan up to date
  • We'd like to have multiple ARI applications connecting to the server: it seems we need to specify a specific application name for each extension

Ideally, I'd like to use ARI to programatically tell Asterisk: hey Asterisk, I'm an ARI application, let me know if there's any calls for extension 12345, and I'll take care of those for you. Is there currently a way to do this, or is it back to editing the dialplan and pointing it to my app by hand?

KenD
  • 5,280
  • 7
  • 48
  • 85

1 Answers1

0

If you want control all via ARI you should do something like this

[default]
exten => _.,1,Noop(need ban this <${CHANNEL(recvip)}>);use fail2ban
exten => h,1,Hangup
[from-trunk]
exten => _.,1,Stasis()
exten => h,1,Hangup

You should not use default context in your peers/extensions

You also can use dynamic realtime and fastagi for control dialplan.

KenD
  • 5,280
  • 7
  • 48
  • 85
arheops
  • 15,544
  • 1
  • 21
  • 27
  • I get `Stasis app_name argument missing` - which means I'd need to hard-code the app name, and as per the OP I'd like to have this "dynamic" so we can have multiple apps connecting – KenD Aug 29 '18 at 14:58