Asterisk and Me
A telephony love story
(All about . . . . )
Brian Capouch
brianc@palaver.net
The plan:
- Some things I've used Asterisk to do
- Wrap an API in graphQL
- Past and present meet next week
Yesterday: 3 Memories
1. Help save Medaryville's history
Challenges
- At-risk historic structures in a dying town
- Security a constant concern
- No money!
cheap openWRT boxes (Netgear WGT-634U)
- Routers/APs/Wifi client
- Asterisk server - local and LD
- Automation controller
2. Wide area "local" calling
Peoples Wireless "WATA"
- Farmers' grain elevators (60-120')
- 900 mi^2 redundant network
- "eBay cheap" desktop at each site
- Asterisk server
- PCI FXO card (X100P)
- "Co-op" dialplan
3. Teaching VoIP
Elective CS class in VoIP
- Started offering 2002
- Textbook a perennial problem
- Evolution
- Began with one shared server
- Finish: local VM, "private cloud," cloud
Today: A little study
What would a graphQL view of the ARI API look like?
The browser is the future
- Universal virtual application container
- Modern functional JavaScript (ES6+)
- "Write once; run everywhere"
REST v. graphQL
-
REST's weaknesses
- API Discovery
- Multiple fetches
- Unused data/wasted bandwidth
- graphQL uses "shared typed schema" approach
Tasks
- Convert Swagger specs to graphql
- Choose appropriate APIs to convert
- Write graphQL wrapper atop ARI
What I tried
- api-spec-converter
- swagger-to-graphql
- APIMATIC
- Manual conversion
Which ARI APIs?
- I wanted to demo both reads and writes
- mailboxes didn't work!
- Chosen for clarity and brevity:
- sounds
- endpoints
Demo Time #1
- schemas
- queries
- mutations
- resolver functions
- The graphiQL UI
Tomorrow: Chasing a dream
MAG*NET
Using Asterisk with historic phone sets
How does a telephone work?
-
Talk Circuit (DC)
- Receiver
- Transmitter
- Induction Coil
- Battery
Signaling circuit (AC!)
- Ringer assembly
- Generator
What about signaling?
. . a short digression
Medaryville Telephone Co.
- 8 switchboards
- About 100 telephone sets
- Ringing and power equipment
- Literature
- Ephemera
Project goals
- Unaltered phones
- Classic call flows (i.e. w/o dials!!)
- Multiple implementations of "operator" function
- Old switchboards
- Live remote human ("Mom")
- ASR and Asterisk
Demo time #2
;;Simple speech recognition
exten => 1234,1,Answer()
same => n,Wait(1)
same => n,Playback(nPlease)
same => n(start),agi(speech-recog.agi,en-US,,,NOBEEP)
same => n,Verbose(1,The text you just said is: ${utterance})
same => n,Set(CALLED_PARTY=${STRREPLACE(utterance,"-","")})
same => n,Playback(uEntered)
same => n,SayDigits(${CALLED_PARTY})
same => n,Verbose(1,And the parsed number is: ${CALLED_PARTY})
same => n,Verbose(1,The probability to be right is: ${confidence})
same => n,Playback(verifyNumber)
same => n,agi(speech-recog.agi,en-US,,,NOBEEP)
same => n,Verbose(1,The text in your command is: ${utterance})
same => n,GoToIf($["${utterance}" = "yes"]?approved:test2)
same => n(test2),GoToIf($["${utterance}" = "yeah"]?approved:retry)
same => n(retry),Verbose(1,We need to try again)
same => n,Playback(beep)
same => n,GoTo(start)
same => n(approved),Playback(uRconnecting)
same => n,Dial(Motif/google/1${CALLED_PARTY}@voice.google.com,,r)
same => n,Hangup()
Astricon
By capouch
Astricon
Keynote talk at Astricon 2017
- 2,509