Twilio enhanced answering machine detection c# -


how use enhanced amd through twilio? understand can done through rest api (no twiml) i'm having hard time seeing connection between standard call , answering machine detection.

i've read through this page few times, still don't understand. here standard c# code placing call through rest api:

    twilioclient.init(accountsid, authtoken);      var = new phonenumber("+14155551212");     var = new phonenumber("+15017250604");     var call = callresource.create(to, from, url: new uri("http://demo.twilio.com/docs/voice.xml")); 

and here c# translated code aforementioned link:

        using (var client = new httpclient())         {             var bytearray = encoding.ascii.getbytes($@"{accountsid}:{authtoken}");             var header = new authenticationheadervalue("basic", convert.tobase64string(bytearray));             client.defaultrequestheaders.authorization = header;              var requestcontent = new formurlencodedcontent(new[]                                                            {                                                                new keyvaluepair<string, string>("to", "+15017250604"),                                                                new keyvaluepair<string, string>("from", "+15017250604"),                                                                new keyvaluepair<string, string>("machinedetection", "detectmessageend"),                                                                new keyvaluepair<string, string>("url", url.action("posttransfer"))                                                            });              var response = client.postasync(_amdrequest, requestcontent);             var responsecontent = response.result.content;         } 

so missing? i'm sure it's simple, i'm not seeing how enhanced amd knows call listen to, , order of events here should be. , finally, how supposed see results?

edit:

so crystal clear, here code sits:

            twilioclient.init(accountsid, authtoken);          var tophone = new phonenumber(to);         var fromphone = new phonenumber(from);         var call = callresource.create(tophone, fromphone, url: new uri("http://demo.twilio.com/docs/voice.xml"));          using (var client = new httpclient())         {             var bytearray = encoding.ascii.getbytes($@"{accountsid}:{authtoken}");             var header = new authenticationheadervalue("basic", convert.tobase64string(bytearray));             client.defaultrequestheaders.authorization = header;              var requestcontent = new formurlencodedcontent(new[]                                                            {                                                                new keyvaluepair<string, string>("to", to),                                                                new keyvaluepair<string, string>("from", from),                                                                new keyvaluepair<string, string>("machinedetection", "detectmessageend"),                                                                new keyvaluepair<string, string>("url", url.action("posttransfer"))                                                            });              var response = client.postasync(_amdrequest, requestcontent);             var responsecontent = response.result.content;         } 

and elsewhere in code function called "posttransfer" gets "answeredby" parameter , stuff after call placed. should working? because isn't. call goes through , can hear twilio's example file play, never gets "posttransfer" function.

twilio developer evangelist here.

you you're making call detection successfully. you're making call twilio number users number.

you see results of answering machine detection when twilio has decided on whether machine or human, @ point makes webhook request url send part of making call.

when twilio makes webhook, include parameter: answeredby. when set machinedetection detectmessageend the values of answeredby can be: machine_end_beep, machine_end_silence, machine_end_other, human, fax, , unknown. can read value , decide call @ point.

does @ all?


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -