voice helpers
See original GitHub issuethe voice helpers are very interesting; what approach do we take? plain xml response? or command to construct xml ? The helpers will be great, this will make voice so easy 👍
voice.say("X is a letter! It's not a word")
Here the approach is to wrap say
around root xml response - what of nested commands? and attributes, how to create the xml response?
Of course this is for incoming calls, with the callback url handler.
voice.call
is ok. I don’t think there’s much there. I mean initiating a call.
voice.say("say something", voice="woman") // ?
Say
then Play
a URL
/*
<Say>Please listen to our awesome record</Say>
<Play url="http://www.myvoicemailserver.com/audio/vmail.wav"/>
*/
voice.say("Hi, listen to", play=url)
and how do we wrap getDigits
when we say
?
voice.say("say something I'm giving ... ", voice=woman, getDigits=True, record=True) // ?
// sadly without named parameters
// also, recording - maybe an attribute to be set
call redirect?
if (dtmfDigit === '9') {
voice.redirect('http://some_url_callback');
}
then, this would be expected.
<Response>
<Dial phoneNumbers="+254711XXXYYY,+254733YYYZZZ,test@ke.sip.africastalking.com" ringBackTone="http://mymediafile.com/playme.mp3" record="true" sequential="true"/>
</Response>
maps to
// callerId specific to calling out from SIP
voice.dial(phoneNumbers=phones, maxDurationInSec=10, record=True,
ringBackTone="some_url", sequential="True", callerId="some_num");
Problem with this is that we need all possible mappings, and I think there’s many cases, we might miss a few and not generate a proper functional XML string, but the XML response will still work.
So, basically we generate this by passing attributes on a command, is this a good approach? we also need a SIP section, will look at this later.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:13 (12 by maintainers)
Top GitHub Comments
Could something like this be a good solution?
that’s perfect! awesome! this will make it so easy to build voice apps on node 💯