<commit_before><commit_msg>DTMF example<commit_after>module.exports = function(callback, config) {
  
  var Promise = require('bluebird');
  var SPACER = '\n****\n\n';

  var Nexmo = require('../lib/Nexmo');

  var nexmo = new Nexmo({
      apiKey: config.API_KEY, 
      apiSecret: config.API_SECRET,
      applicationId: config.APP_ID,
      privateKey: config.PRIVATE_KEY
    },
    {debug: config.DEBUG}
  );
  
  var calls = Promise.promisifyAll(nexmo.calls);
  var dtmf = Promise.promisifyAll(nexmo.calls.dtmf);
  var callId = null;
  nexmo.calls.getAsync()
    .then(function(resp) {
      callId = resp._embedded.calls[0].uuid;
      return dtmf.sendAsync(
          callId,
          {digits: [1, 2, 3, 4]}
        );
    })
    .then(function(resp) {
      callback(null, resp);
    })
    .then(function(resp) {
      callback(null, resp);
    })
    .catch(callback);
};

{'fraction_non_alphanumeric': 0.15288788221970556, 'fraction_numerical': 0.0056625141562853904, 'mean_word_length': 2.6378600823045266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1433443', 'n_tokens_mistral': 325, 'n_tokens_neox': 316, 'n_words': 55}