How to get multiple inbound calls with a dialplan?

Hi. I trying to make an ivr system, and tested 2 calls simultaneously,
thr second call does not seem to be answered.

I am using asterisk 18.12.1 with ubuntu 20.4 and chan_pjsip.
I set endpoint’s aor max_contacts = 2.

[provider]
type = aor
contact = sip:0707663@211.233.:5060
max_contacts = 3

and CLI log is this

    == WebSocket connection from '127.0.0.1:53386' for protocol '' accepted using version '13'
      -- Executing [0707663@incoming:1] Log("PJSIP/provider-0000000a", "NOTICE, Dialing out from "" <0109728> to 707663 through 07076630135") in new stack
  [Jul  8 01:50:05] NOTICE[25304][C-0000000b]: Ext. 0707663:1 @ incoming:  Dialing out from "" <0109728> to 707663 through 0707663
      -- Executing [0707663@incoming:2] Stasis("PJSIP/provider-0000000a", "test") in new stack
         > 0x7f0ccc01d840 -- Strict RTP learning after remote address set to: 211.233.:20774
      -- <PJSIP/provider-0000000a> Playing 'hello-world.ulaw' (language 'en')
         > 0x7f0ccc01d840 -- Strict RTP switching to RTP target address 211.233.:20774 as source
      -- Executing [0707663@incoming:1] Log("PJSIP/provider-0000000b", "NOTICE, Dialing out from "" <0106322> to 707663 through 0707663") in new stack
  [Jul  8 01:50:09] NOTICE[25308][C-0000000c]: Ext. 0707663:1 @ incoming:  Dialing out from "" <0106322> to 7076630135 through 0707663
      -- Executing [0707663@incoming:2] Stasis("PJSIP/provider-0000000b", "test") in new stack
         > 0x7f0ccc01d840 -- Strict RTP learning complete - Locking on source address 211.233.:20774

(Part of ip address and telephone number is masked.)
Can anyone tell me what to check?

You have two incoming calls that have both transited the dialplan into Stasis. You don’t have to do anything more to achieve your subject line requirement…

As you haven’t provided the ARI application, I’ve no idea what you want to do beyond that.

Can you explain why you don’t think the log shows your successfully meeting the headline requirement?

Also, you only provided the type=aor section, but that is not used for inbound calls.

Thanks for reply,
I’m testing with the node-ari sample with promises:

var client = require('ari-client'),
    Promise = require('bluebird'),
    util = require('util');
const fs = require('fs');
let setting = JSON.parse(fs.readFileSync('./settings.json'));
const mariaDb = require('mariadb');
let dbConnected = false;
const db = mariaDb.createPool(setting.maria_Pool);
    
db.getConnection()
    .then(conn => {
        console.log('db connected ok! ' + conn.threadId);
        conn.end(); //release to pool
    })
    .catch(err => {
        console.log('not connected ! err: ' + err);
    });
    
client.connect('http://localhost:8088', 'user', 'secret')
  .then(function (ari) {
    ari.once('StasisStart', channelJoined);

    function channelJoined (event, incoming) {
      incoming.on('ChannelDtmfReceived', dtmfReceived);
      incoming.on('StasisEnd', stasisEnd);
      incoming.on('ChannelDestroyed', channelDestroyed);
      incoming.answer()
        .then(function () {
          return play(incoming, 'sound:hello-world');
        })
        .catch(function (err) {});
    }

    function dtmfReceived (event, channel) {
      var digit = parseInt(event.digit);
      
      switch (digit) {
        case '#':
          play(channel, 'sound:vm-goodbye')
            .then(function () {
              return channel.hangup();
            })
            .finally(function () {
              process.exit(0);
            });
          break;
        case '*':
          play(channel, 'sound:tt-monkeys');
          break;
        default:
          play(channel, util.format('sound:digits/%s', digit));
      }
    }

    function play (channel, sound) {
      var playback = ari.Playback();
      return new Promise(function (resolve, reject) {
        playback.on('PlaybackFinished', function (event, playback) {
          resolve(playback);
        });
        channel.play({media: sound}, playback)
          .catch(function (err) {
            console.log(err);
            reject(err);
          });
      });
    }
    ari.start('test');
  })
  .done(); // program will crash if it fails to connect

and the log shows that it does not play sound in second call(Playing ‘hello-dowld.ulaw’ line),
so I think the second call is not fully work.

I haven’t used ARI, and I certainly haven’t used the class library you are using, but I suspect that you are blocking in the event handler, preventing any more events being handled i.e. this is an ARI application problem, not a dialplan (or ARI protocol) one.

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