jefflinwood / twilio_client_phonegap

Phonegap plugins for the Twilio Client iOS and Android SDKs
MIT License
59 stars 53 forks source link

Calling the Divice.disconnect() function #10

Open irregularprofit opened 9 years ago

irregularprofit commented 9 years ago

Hi Jeff. Sorry. I have another issue again.

I am trying to hangup on a incoming call to the client, by calling disconnect() on the connection. However, the call proceeds to continue ignoring the function call. The .accept() call works absolutely fine though. As does the disconnectAll() call to end the connection.

I tried looking into it myself. And I found something to didn't seem quite right to me. It's https://github.com/jefflinwood/twilio_client_phonegap/blob/master/www/tcPlugin.js#L110-L116 It looks like fn is passed into the disconnect function, but it isn't used. Instead, the function refers to an argument.

I tried changing that myself with no success. So I wondering if something else is causing my problems.

jefflinwood commented 9 years ago

Hi,

The highlighted code there is the Connection disconnect - does the Device.disconnect() function work?

I can dig into it a little more.

Thanks! Jeff

irregularprofit commented 9 years ago

According to the Twilio.Device client http://www.twilio.com/docs/client/device There is no Device.Disconnect() method. There is just the disconnect handler http://www.twilio.com/docs/client/device#disconnect

The only disconnect function I could find is on The Twilio.Connection object, which is what I am trying to call.

jefflinwood commented 9 years ago

Just noticed in my little sample app I wrote for testing, I was using disconnectAll() to disconnect. Let me look into this and figure out if it's an easy fix to make disconnect() work on the Connection. Thanks!