Digium.Phone.Dial isn't working for me

Community based support for the Digium Phone Application Programming Interface (API).

Moderators: jwitt, sruffell, malcolmd, Moderator

Digium.Phone.Dial isn't working for me

Postby markgc2014 » Fri Jun 27, 2014 6:35 pm

I have hooked up my observer so that I can receive commands from AMI DPMA, and now I can answer a ringing call by sending a message from the server - which is great

The next thing I want to be able to do though is make a call - so the call starts the 'normal' way ie from the phone rather than Asterisk making the call and sending it to the phone.

According to the examples etc, the following should work - but it doesnt

var newCall = digium.phone.dial({ 'number': '240' });

Also, I dont seem to get anything in the 'View Debug Log' window - the window itself shows but it never has anything in it

I have tried using util.debug and also print - neither of them produce any output in the debug log
markgc2014
Newsterisk
 
Posts: 14
Joined: Wed Jun 25, 2014 5:54 pm

Re: Digium.Phone.Dial isn't working for me

Postby sruffell » Fri Jun 27, 2014 7:31 pm

Unless there is something else going on in your setup, I can see that this works in mine.

For example if I update the helloworld.js app to:

Code: Select all
var app = require('app');
app.init();
var util = require('util');
var screen = require('screen'); screen.clear();
var hello = new Text(0, 0, window.w, Text.LINE_HEIGHT, 'Hello World');
window.add(hello);

digium.app.exitAfterBackground = false;

digium.phone.dial({number:'1337', handler: function(obj) {util.debug(obj.state);}});


And run it I get the following in a log window:

Code: Select all
sruffell@sruffell-desktop:~/digium-phone-apps/helloworld$ ./update.sh log
+Done loading util.js
app.js:Init
         app.init:appConfigXML:{"$NAME":"appconfig","$CHILDREN":[]}
         app.init:this.config:{}
auth.js:Constructor
Could not load app specific language keys for fallback lang: en_us
Could not load app specific language keys for lang: en_us
CALLING
CONNECTING
CONNECTING
CONFIRMED
DISCONNCTD


Does the above work in your environment?
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm

Re: Digium.Phone.Dial isn't working for me

Postby markgc2014 » Sun Jun 29, 2014 5:47 pm

Thanks for your detailed response.

Unfortunately it is still not working for me - the dial doesnt work even though I literally copied your line of code and changed the phone number

Also I still get nothing in the debug log - what browser are you using ?

Just to elaborate, I have other code in my js file which is keeping track of incoming calls and I can send a command through to trigger the digium.phone.answer command and that works fine - so the script is valid and running etc in case you were wondering.

I am running a D40 with 1_4_2_0_63880 firmware, and my browser is chrome but I have tried with IE11 as well
markgc2014
Newsterisk
 
Posts: 14
Joined: Wed Jun 25, 2014 5:54 pm

Re: Digium.Phone.Dial isn't working for me

Postby sruffell » Sun Jun 29, 2014 5:53 pm

Also I still get nothing in the debug log - what browser are you using ?


I'm actually not using a browser, but just showing the log in a command window using update.sh in the helloworld example.

Ok, I'll try it out tomorrow with a D40 and your firmware to see what I can see. The quick test I did above was with a D70 and firmware version 1_3_3_0_55755 which is what I have running on my home desk phone.
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm

Re: Digium.Phone.Dial isn't working for me

Postby markgc2014 » Sun Jun 29, 2014 6:19 pm

Doh!

Just used curl to see the output - curl works

and once I did that I could see my make call event wasnt even hooked up - damn that case sensitivity

all good now - thanks very much for your efforts and assistance
markgc2014
Newsterisk
 
Posts: 14
Joined: Wed Jun 25, 2014 5:54 pm


Return to Digium Phone API

Who is online

Users browsing this forum: No registered users and 2 guests

cron