Stuff we noticed while building "Asterisk in the cloud"

Post on 23-Jan-2015

1,240 views 1 download

description

Stuff we noticed while building "Asterisk in the cloud." As delivered to Atlanta Asterisk Users Group in 2010.

transcript

stuff we noticed while buildingAsterisk in the cloud

Atlanta Asterisk Users Group

Troy Davistroy@yort.com

twitter.com/troyd

cloudvox.com@cloudvox@ifbyphone

Every cloud is special in its own way

Automated Phone Calls

• Riding on 10 years • Have framework(s), need appS• What can we build, quickly?

AGI

• Java (Asterisk-Java)• Ruby (Adhearsion, Telegraph, RAGI)• Perl (Asterisk::FastAGI)• PHP (PHP-AGI)• Python (Twisted/StarPy)• C# (monotone, Asterisk.NET)• C (CAGI)

Adhearsion

• Serverahn start daemon voiceapp/

Adhearsion

• Serverahn start daemon voiceapp/ • Entry points

server hits:   agi://any.where.org/acontext?b=cclient runs:  acontext { Ruby-as-dialplan }

Dialplan Representations

Bindings match Asterisk• Exposes native Asterisk calls• Different languages (mostly) look the same• PHP-AGI, Asterisk::AGI, basic Asterisk-Java, RAGI

Dialplan Representations

Bindings match Asterisk• Exposes native Asterisk calls• Different languages (mostly) look the same• PHP-AGI, Asterisk::AGI, basic Asterisk-Java, RAGI

Bindings match language model• Wrap head around abstraction• Easier to maintain, harder to replace• Adhearsion, full Asterisk-Java, Telegraph

Dialplan Representations

Bindings match Asterisk• Exposes native Asterisk calls• Different languages (mostly) look the same• PHP-AGI, Asterisk::AGI, basic Asterisk-Java, RAGI

Bindings match language model• Wrap head around abstraction• Easier to maintain, harder to replace• Adhearsion, full Asterisk-Java, Telegraph

Think like Asterisk or think like the language?

PHP-AGI

• Serverxinetd • Entry points

server hits:   agi://any.where.org/?b=cxinetd executes:  myapp.php # very dialplan-ish PHP

gist.github.com/4670 - Adhearsion

gist.github.com/4670 - get phone #

Phone + HTTP service (Telegraph)

• Don't transfer burden to user• Where does phone-specific code sit?• Latency

IVR forms (Telegraph)

tinyurl.com/marsphoenix - Poll

 

tinyurl.com/marsphoenix - Call

• App-initiated• Channels• Sync/async

Testing

• “Can you here me now?” is barely testing

Process

• “Can you here me now?” is barely testing

• Paper first• Small first• Placeholders first

• Debugging tools

Deployment

AGI(agi://else.where.com/agi.pl|arg1|arg2|...)

or

AGI(agi.pl|arg1|arg2|...)

Harder than it could be

• ASR & good TTS• SMS• Video

DTMF Anywhere

Event: DTMF

Privilege: dtmf,allChannel: IAX2/instance-X-YYYUniqueid: cloudvox.com-12345Digit: 5Direction: ReceivedBegin: NoEnd: Yes

Conference Pipes

• fake conference call participant

• creative use of Originate 

• Channel + Context 

= magic Music on Hold, Playback, Speak, <anything> intoa conference room

Bring your own carrier, or don't

• carriers are specialized

• Cloudvox isn't everywhere

• we're a hosting service

sip:<any number or exten>@<x>.cloudvox.com

Bring your own carrier, or don't

• carriers are specialized

• Cloudvox isn't everywhere

• we're a hosting service

sip:<any number or exten>@<x>.cloudvox.com

• priced for use: remote SIP == 1 cent per minute

Number metadata API (free)http://digits.cloudvox.com/4252101234.json

Number metadata API (free)http://digits.cloudvox.com/2124561111.json (White House)

Number metadata API (free)http://digits.cloudvox.com/6506929100.json

<phone number you care about>

<phone number you care about>

http://digits.cloudvox.com/

<phone number you care about> <.json>

http://digits.cloudvox.com/

DNS API

host -t TXT 2065460420.na.digits.cloudvox.com

What can I do?

• Get realtime number info from existing tools

• Augment phone number displays

• Analyze a group of numbers

• Customize call logic

Be lazy in what you send,and liberal in what we accept.

• 10, 7, 6, 3 digits

• Already parsed, or best guess

• Same reply format for all queries

• REST, DNS, browser

AGI + SMS to same numbers

• "Call or SMS 206-555-1234"

• No short code or shared code

• Not integrated with Asterisk (HTTP is simpler)

• Maybe down the road?

Asterisk scaling: call-as-unit

Asterisk scaling: data store routing

Asterisk scaling: standard components

Asterisk scaling: escape valve(s)

Questions?

Troy Davis

troy@yort.comtwitter.com/troyd

cloudvox.com

@cloudvox@ifbyphone