Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kynetx twilio:place_call

Tags:

krl

According to the docs I should be able to have Twilio initiate a call for me with

twilio:place_call( "3125551212", "7735551212", somewebhook);

I can't seem to get it working quite right. Does the webhook need to be there, and if so what should it respond with? I just want to initiate a phone call and have it connect me with my phone- I don't need any other Twilio intervention.

UPDATE:

Okay I think I got it worked out. The webhook (which I'm just putting into KRL) just needs this: twilio:dial("7735551212"); where that number is my number. So the person receiving the call from me will have a few seconds of dead air pause when they first pick up. To help with that, I'm also prepending it with this twilio:say("Hi, one moment please"); Here's the final rule:

rule twilconnect is active {
select when twilio twilconnect                     
{
    twilio:say("Hi, one moment please");        
    twilio:dial("7735551212");
}

}

And the rule that initializes everything looks like this:

rule makethecall is active {
  select when web make_the_call
  pre {
    tocall = event:param("tocall");
  }

  {         
    notify("Calling " + tocall,"...");
    twilio:place_call( tocall, "+17735551212", "http://webhooks.kynetxapps.net/t/{appid}/twilconnect");       
  }

}

like image 208
Jed Avatar asked Dec 08 '25 23:12

Jed


1 Answers

You seemed to have answered your own question, but here seems to be the issue that confused you.

The twilio module's place_call() action is used when you need to initiate a new outbound call when there isn't already a call.

When you want to have an already in process call that you want to connect to an external number, you want the dial() action.

like image 187
TelegramSam Avatar answered Dec 12 '25 10:12

TelegramSam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!