asterisk / node-ari-client

Node.js client for ARI. This library is best effort with limited support.
Other
250 stars 98 forks source link

'ChannelDtmfReceived' event not emitting #85

Closed mpbanna closed 7 years ago

mpbanna commented 7 years ago

hello , when i put more than one channel in a bridge, in this case event 'ChannelDtmfReceived' not emitting for all those channel , who are in created bridge.

Note :- event 'ChannelDtmfReceived' is emitting ,when single channel in a bridge.

samuelg commented 7 years ago

Can you share some code to show your setup? How about the version of Asterisk you are using? We could then try to see if it's the client or Asterisk that is causing the issue.

mpbanna commented 7 years ago

My code is much complex, it is difficult to understand, because many library(created by me) are including. currently i am using asterisk version 13.13.1, please give me any solution.

mpbanna commented 7 years ago

Hello, please check my code and give me solution: //***** 'use strict'; var ari = require('ari-client'); var logger = require('mylogger'); var ARI_HOST = '*...*'; //this is dummy value var ARI_PORT = **; //this is dummy value var ARI_USER = ''; //this is dummy value var ARI_PASS = '**'; //this is dummy value var appName = '**'; //this is dummy value

ari.connect('http://' + ARI_HOST + ':' + ARI_PORT, ARI_USER, ARI_PASS, clientLoaded); var sourceBridgeId = ""; function clientLoaded(err, client) { logger.log('connected...') if (err) { logger.error(err); process.exit(1); } var bridge = client.Bridge(); bridge.create(function (err, bridge) { if (err) { logger.error(err); return; } sourceBridgeId = bridge.id; });

client.on('StasisStart', function (event, channel) {
    logger.log('statsis started !!!!!!!!!!!!!!!!!!!!!');
    if (sourceBridgeId != "") {
        client.bridges.addChannel(
                {bridgeId: sourceBridgeId, channel: channel.id},
        function (err) {
            if (err) {
                logger.error(err);
            }
            logger.log('channelId:', channel.id, ' , added into bridgeId:', sourceBridgeId);
        });
    }
});
client.on('StasisEnd', function (event, channel) {
    logger.info('statsis END  !!!!!!!!!!!!!!!!!!!!!')
});
client.on('ChannelDtmfReceived', function (event, channel) {
    var digitPressed = event.digit;
    logger.log('channelID:', channel.id, ' , channel pressed:', digitPressed)
});
client.start(appName);

}

mpbanna commented 7 years ago

hello sir, is there any solution ??

samuelg commented 7 years ago

If you look at https://github.com/asterisk/node-ari-client#available-parameters-17 you'll see that you can pass a comma delimited list for the type of bridge to create.

If you want to have DTMF within a bridge for multiple channels you probably want the following when creating the bridge:

bridge.create({type: 'mixing,dtmf_events'}, callback);
mpbanna commented 7 years ago

Thanks it is working, can you explain what is meaning of these comma separated value (mixing, holding, dtmf_events, proxy_media).

chadxz commented 7 years ago

See "bridge types" on https://wiki.asterisk.org/wiki/display/AST/Introduction+to+ARI+and+Bridges

On May 12, 2017 7:07 AM, "mahipal singh chundawat" notifications@github.com wrote:

Thanks it is working, can you explain what is meaning of these comma separated value (mixing, holding, dtmf_events, proxy_media).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/asterisk/node-ari-client/issues/85#issuecomment-301059430, or mute the thread https://github.com/notifications/unsubscribe-auth/AAS34-WhizxgLuDbZf9x0SSHHOAWDrw_ks5r5EuBgaJpZM4Myy6I .