I want to send parameter in outgoing call. Then I will get the parameters in incoming call for another user. How and where it's possible to make.
Related
I have a number which I have configured to use a TwiML App. In the App itself, I have set the VoiceURL and StatusCallback on the Voice section.
The issue is, the callback is triggered when there is an incoming call to the Twilio-bought number.
However, if I place an outgoing call from the Twilio-bought number, the callback is not triggered.
Is this the expected behaviour, that the TwiML app callback is only triggered on incoming calls?
If this is not the intended behaviour, any pointers on what may be going wrong?
That is expected, that statusCallback URL handles only the incoming call leg.
If you are forwarding that call(which creates another call leg), you can use the parameter of the name name of the Number noun to capture events.
If you are using the REST API to make an outbound call, it has a statusCallback parameter as well.
Is there any way to change what events trigger the status callback? Normally you can use statusCallbackEvent but I can't seem to find a way to make this work for the Voice SDK's leg of the call. It works fine on the call leg of the outbound participant, but not the Voice SDK's call leg. I only get completed status event for this leg (and I also can get ringing from the called action url).
Things I tried without success:
Updating the call using the REST api to set statusCallbackEvent to initiated ringing answered completed when the outbound call starts
Setting statusCallbackEvent as an outbound parameter on the Voice SDK's token (in PHP you can set custom parameters using $clientToken->allowClientOutgoing(...) but it seems normal parameters cannot be modified)
I really wish you could set this on the TwiML Application so that any numbers calling out with that application set will just automatically use your set events. That or let me set the parameters on the client's token.
One way to fix this is just to poll for the information but that is an ugly hack and isn't real time.
Twilio developer evangelist here.
I don't think you can do what you're asking for here, but for good reason.
When you are placing the call from the Voice SDK, that call leg is then between the application and Twilio. You know the call was "initiated", because you started it. There is no "ringing" because Twilio is not a phone and won't ring. You know it is "answered" because a request is made to your voice URL defined by the TwiML app. And finally, you do get the "completed" event.
As you say, you do get the events for the outbound leg of the call from Twilio to another phone number.
I have been using Twilio with a node and Angular project to build a call centre. All the incoming and outgoing calls are made to conference call to make it easy to add participants for transfer call etc.
In the Angular project, I have been using Twilio device to initialise a connection to accepts calls. The parameters that I always receive from the clinet are from, to, callSid and accountSid. I need to find the conferenceSid to add a participant to the call. Is there a way I can get the conferenceSid with just the callSid?
You can use conference eventing to capture the ConferenceSID the participants are joining. However, not clear on the call flow of how your are connecting participants into the conference.
TwiML™ Voice: Conference - statusCallbackEvent
I would like to initiate an outgoing call from twilio to a number provided by a service like nexmo and be able to listen to the response.
Based on the voice message back from the receiver, i would like to determine my response
I have gone through the documentation, and from what i can make out, the outgoing call does not give me an access to the incoming stream. The Call object allows me to control the call, but not based on the voice response
client.calls
.create({
url: 'http://demo.twilio.com/docs/voice.xml',
to: '+15558675310',
from: '+15017122661'
})
.then(call => console.log(call.sid));
The call object does not provide me a way to access the conversation audio.
Overall, I would like the call to be initiated and my caller program to get access to the response voice messages that it can parse and then determine the next response.
Should i consider SIP for this scenario, since the destination number will also be having a SIP endpoint?
I was able to achieve this with the standard Twiml
The Gather verb of twilio will wait to receive voice packet and then perform speech recognition on it and send back the text.
In response to this callback, i am sending back the next audio to play and immediately followed by the next Gather.
I am sending a call to a twilio number using twilio api, and in turn recording the sid of the call (e.g. CAb90f709e54017969776d842873311746). While the call is received in the webhook I have a different sid in the receiver end (e.g. CA8d85ac8d8b169de8b0509c8585c6aaed ). Is there any way to map the call sent to the call received ?
Twilio developer evangelist here.
Yes, you can! You should find that the call on the receiver end, which is the second or child leg of the call, has a parameter called ParentCallSid which will point back to the first leg of the call.
In your example, the CallSid will be CA8d85ac8d8b169de8b0509c8585c6aaed and the ParentCallSid will be CAb90f709e54017969776d842873311746.
Let me know if that helps at all.