twilio - Twillio Client To Client Call ios Never Recieve call method is didReceiveIncomingConnection -


i working on ios application using twilio sdk manage client calling through device. implement using hello monkey demo application have imported in xcode. after initial setup able establish connection receiving delegate no longer working. have gone through complete twilio documentation no success. please suggest alternative or solution asap. here code of hello monkey sample project

- (void)viewdidload {      nslog(@"clint id-----------------------     %@",name);      //check out https://github.com/twilio/mobile-quickstart server     nsstring *urlstring = [nsstring stringwithformat:@"https://testdemo786.herokuapp.com/token?client=%@", name];     nsurl *url = [nsurl urlwithstring:urlstring];     nserror *error = nil;     nsstring *token = [nsstring stringwithcontentsofurl:url encoding:nsutf8stringencoding error:&error];     if (token == nil) {         nslog(@"error retrieving token: %@", [error localizeddescription]);     } else {         _phone = [[tcdevice alloc] initwithcapabilitytoken:token delegate:self];      } }  - (ibaction)dialbuttonpressed:(id)sender {     nsstring *to;     if ([name isequaltostring:@"jenny"]) {         to=@"client:tommy";     }     else     {         to=@"client:jenny";     }       to=@"4nmf5j";     nslog(@"to---------------------%@",to);     nsdictionary *params = @{@"to": to};      _connection = [_phone connect:params delegate:nil]; }  - (ibaction)hangupbuttonpressed:(id)sender {     [_connection disconnect]; }  - (void)device:(tcdevice *)device didreceiveincomingconnection:(tcconnection *)connection {     nslog(@"incoming connection from: %@", [connection parameters][@"from"]);     if (device.state == tcdevicestatebusy) {         [connection reject];     } else {         [connection accept];         _connection = connection;     } }  -(void)connection:(tcconnection*)connection didfailwitherror:  (nserror*)error{      nslog(@"connection failed error : %@", error);  }  -(void)connectiondidstartconnecting:(tcconnection*)connection{     nslog(@"connection started"); }  -(void)connectiondiddisconnect:(tcconnection*)connection{     nslog(@"connection disconnected"); }  -(void)connectiondidconnect:(tcconnection*)connection{     nslog(@"connected"); }  - (void)devicedidstartlisteningforincomingconnections:  (tcdevice*)device {     nslog(@"device: %@ devicedidstartlisteningforincomingconnections",   device); }  - (void)device:(tcdevice *)device didstoplisteningforincomingconnections:(nserror *)error {     nslog(@"device: %@ didstoplisteningforincomingconnections: %@", device, error); } 

twilio evangelist here.

its bit hard tell code included, correct me.

here couple of things check:

  1. did add tcdevicedelegate protocol on interface:

    @interface fooviewcontroller() <tcdevicedelegate> 
  2. are sure passing correct client name connect method, , twiml being returned twiml apps voice request url including name properly?

    you check looking @ twilio monitor see if twilio logged errors when retrieving or parsing twiml. can check twilio call logs see twilio says outcome of inbound , outbound call legs were.

hope helps.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -