Stuff we noticed while building "Asterisk in the cloud"

39
stuff we noticed while building Asterisk in the cloud Atlanta Asterisk Users Group Troy Davis [email protected] twitter.com/troyd cloudvox.com @cloudvox @ifbyphone

description

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

Transcript of Stuff we noticed while building "Asterisk in the cloud"

Page 1: Stuff we noticed while building "Asterisk in the cloud"

stuff we noticed while buildingAsterisk in the cloud

Atlanta Asterisk Users Group

Troy [email protected]

twitter.com/troyd

cloudvox.com@cloudvox@ifbyphone

Page 2: Stuff we noticed while building "Asterisk in the cloud"

Every cloud is special in its own way

Page 3: Stuff we noticed while building "Asterisk in the cloud"

Automated Phone Calls

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

Page 4: Stuff we noticed while building "Asterisk in the cloud"

AGI

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

Page 5: Stuff we noticed while building "Asterisk in the cloud"

Adhearsion

• Serverahn start daemon voiceapp/

Page 6: Stuff we noticed while building "Asterisk in the cloud"

Adhearsion

• Serverahn start daemon voiceapp/ • Entry points

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

Page 7: Stuff we noticed while building "Asterisk in the cloud"

Dialplan Representations

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

Page 8: Stuff we noticed while building "Asterisk in the cloud"

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

Page 9: Stuff we noticed while building "Asterisk in the cloud"

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?

Page 10: Stuff we noticed while building "Asterisk in the cloud"

PHP-AGI

• Serverxinetd • Entry points

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

Page 11: Stuff we noticed while building "Asterisk in the cloud"

gist.github.com/4670 - Adhearsion

Page 12: Stuff we noticed while building "Asterisk in the cloud"

gist.github.com/4670 - get phone #

Page 13: Stuff we noticed while building "Asterisk in the cloud"

Phone + HTTP service (Telegraph)

Page 14: Stuff we noticed while building "Asterisk in the cloud"

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

IVR forms (Telegraph)

Page 15: Stuff we noticed while building "Asterisk in the cloud"

tinyurl.com/marsphoenix - Poll

 

Page 16: Stuff we noticed while building "Asterisk in the cloud"

tinyurl.com/marsphoenix - Call

• App-initiated• Channels• Sync/async

Page 17: Stuff we noticed while building "Asterisk in the cloud"

Testing

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

Page 18: Stuff we noticed while building "Asterisk in the cloud"

Process

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

• Paper first• Small first• Placeholders first

• Debugging tools

Page 19: Stuff we noticed while building "Asterisk in the cloud"

Deployment

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

or

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

Page 20: Stuff we noticed while building "Asterisk in the cloud"

Harder than it could be

• ASR & good TTS• SMS• Video

Page 21: Stuff we noticed while building "Asterisk in the cloud"

DTMF Anywhere

Event: DTMF

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

Page 22: Stuff we noticed while building "Asterisk in the cloud"

Conference Pipes

• fake conference call participant

• creative use of Originate 

• Channel + Context 

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

Page 23: Stuff we noticed while building "Asterisk in the cloud"

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

Page 24: Stuff we noticed while building "Asterisk in the cloud"

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

Page 25: Stuff we noticed while building "Asterisk in the cloud"

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

Page 26: Stuff we noticed while building "Asterisk in the cloud"

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

Page 27: Stuff we noticed while building "Asterisk in the cloud"

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

Page 28: Stuff we noticed while building "Asterisk in the cloud"

<phone number you care about>

Page 29: Stuff we noticed while building "Asterisk in the cloud"

<phone number you care about>

http://digits.cloudvox.com/

Page 30: Stuff we noticed while building "Asterisk in the cloud"

<phone number you care about> <.json>

http://digits.cloudvox.com/

Page 31: Stuff we noticed while building "Asterisk in the cloud"

DNS API

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

Page 32: Stuff we noticed while building "Asterisk in the cloud"

What can I do?

• Get realtime number info from existing tools

• Augment phone number displays

• Analyze a group of numbers

• Customize call logic

Page 33: Stuff we noticed while building "Asterisk in the cloud"

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

Page 34: Stuff we noticed while building "Asterisk in the cloud"

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?

Page 35: Stuff we noticed while building "Asterisk in the cloud"

Asterisk scaling: call-as-unit

Page 36: Stuff we noticed while building "Asterisk in the cloud"

Asterisk scaling: data store routing

Page 37: Stuff we noticed while building "Asterisk in the cloud"

Asterisk scaling: standard components

Page 38: Stuff we noticed while building "Asterisk in the cloud"

Asterisk scaling: escape valve(s)

Page 39: Stuff we noticed while building "Asterisk in the cloud"

Questions?

Troy Davis

[email protected]/troyd

cloudvox.com

@cloudvox@ifbyphone