SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Asterisk, HTML5 and NodeJS;
a world of endless possibilities
            Dan Jenkins
           Astricon 2012
                                @dan_jenkins
                               @holidayextras
The next half an hour....
• Introductions

• Who Holiday Extras are

• HTML5

• What’s NodeJS

• How we’ve used NodeJS within our production environment

• Demonstration
Who am I?
                 el op er         Dan Jenkins
             D ev
           eb neer
       r W ngi                    @dan_jenkins              2 Years
S   io
  en oIP E
     &   V



                            Author of Asterisk-AMI Module
It’s in the name, we sell extras for holidays
                            We’re partners with some big names in the UK
                                                          travel industry


                    Theme Park Breaks
                                                                easyJet
                   Legoland, Alton Towers
                     to name just a few                  British Airways
                                                           Thomas Cook
                     Theatre Breaks
Since moving to Asterisk,
                                                   Over 800,000 calls through
    we’ve taken ~516,000 phone
    calls in our Contact Centre                    our Contact Centre last year

                                     We are the market leaders!
 We believe Holidays
should be Hassle Free                                We’ve been using Asterisk
                                                     in production since April
               Operate in mainland Europe
               too, with Holiday Extras DE                   We’re a 29 year old start up
Get on with it!
What’s so great about HTML5?
Easier to iterate, there’s millions of
    web developers out there                No extra plugins required!


            Faster time to launch
                                         Over 60% of users with Internet
                                           access have browsers that
     Make fully featured apps                   suppport HTML5
      direct in the browser
What can you do with HTML5?
                                Client-side databases
 Get User Media
(Microphone & Video)                                    Offline Application cache

                                Web workers
                                 (Threads)
           WebRTC                                        Two way, real-time,
   (SIP phone in the browser)                              communication
So, what’s NodeJS?


“Node.js uses an event-driven, non-blocking I/O model that
makes it lightweight and efficient, perfect for data-intensive
real-time applications that run across distributed devices.”
What have Holiday Extras done?
     Integrated control of the call directly into our in-house CRM
   system, this also allows us to look up our customer in realtime

We’ve been through about 3 iterations of the integration
NodeJS and HTML5 have given us the ability to do this
We are able to move fast to react to the current needs of our business
How does it all fit together?
            NodeJS
                                                      Asterisk
            Server




Web Sockets
Asterisk-AMI TCP Socket
SIP                       Chrome   Firefox   Safari
                           + SF     + SF     + SF
Now for the demo


                    @dan_jenkins
                   @holidayextras
Firstly, install the module

                                npm install asterisk-ami



Prerequisite: install NodeJS first!
Create a basic NodeJS server

 Output a ping response from Asterisk in the
    command line, from the NodeJS app
server.js
var AsteriskAmi = require('asterisk-ami');
var ami = new AsteriskAmi( { host: '172.16.172.130', username: 'astricon', password:
'secret' } );

ami.on('ami_data', function(data){
  console.log('AMI DATA', data);
});

ami.connect(function(response){
  console.log('connected to the AMI');
  setInterval(function(){
    ami.send({action: 'Ping'});//run a callback event when we have connected to the socket
  }, 2000);
});

process.on('SIGINT', function () {
  ami.disconnect();
" process.exit(0);
});



                           github.com/danjenkins/astricon-2012
Time to step it up a notch,
let’s make it output to a webpage
       Output that same ping response
         to a browser, using NodeJS
server.js
var   AsteriskAmi = require('asterisk-ami');
var   nowjs = require("now");
var   fs = require('fs');
var   express = require('express');
var   http = require('http');

var ami = new AsteriskAmi( { host: '172.16.172.130', username: 'astricon',
password: 'secret' } );
var app = express();
var server = http.createServer(app).listen(8080, function(){
  console.log('listening on http://localhost:8080');
});

app.configure(function(){
  app.use("/assets", express.static(__dirname + '/assets'));
});


                         github.com/danjenkins/astricon-2012
app.use(express.errorHandler());
app.get('/', function(req, res) {
  var stream = fs.createReadStream(__dirname + '/webpage.html');
  stream.on('error', function (err) {
      res.statusCode = 500;
      res.end(String(err));
  });
  stream.pipe(res);
})

var everyone = nowjs.initialize(server);

ami.on('ami_data', function(data){
  if(everyone.now.echoAsteriskData instanceof Function){
    everyone.now.echoAsteriskData(data);
  }
});


                       github.com/danjenkins/astricon-2012
ami.connect(function(response){
  console.log('connected to the AMI');
  setInterval(function(){
    ami.send({action: 'Ping'});//run a callback event when we have connected to
the socket
  }, 2000);
});

process.on('SIGINT', function () {
  ami.disconnect();
  process.exit(0);
});




                       github.com/danjenkins/astricon-2012
webpage.html
<script type="text/javascript" src="/nowjs/now.js"></script>

<script type="text/javascript">
  var output = function(data){
  var html = '<div>' + (data instanceof Object ? JSON.stringify(data) : data) + '</div>';
  var div = document.getElementById('output');
   div.innerHTML = html + div.innerHTML;
  }

  now.echoAsteriskData = function(data){
   output(data);
  }

  now.ready(function(){
    output('connected via nowjs');
  });
</script>




                           github.com/danjenkins/astricon-2012
Now, let’s create a call from the webpage
   via Bria - Asterisk 11 - SIP Phone
     Let’s make the browser do something, make it create
              a call between two sip extensions
server.js

+everyone.now.send_data_to_asterisk = function(data){
+  console.log('got data from browser', data);
+  ami.send(data);
+}




                           github.com/danjenkins/astricon-2012
webpage.html

$('.btn').click(function(e){
   var obj = {};
  if($(this).is('.help')){
   obj = {action: 'ListCommands'};
  }else if($(this).is('.reload')){
    obj = {action: 'reload'};
  }else if($(this).is('.login')){
    obj = {action: 'QueueAdd', queue: '10', interface: 'sip/2000', penalty: 1, paused:
true};
  }else if($(this).is('.unpause')){
    obj = {action: 'QueuePause', queue: '10', interface: 'sip/2000', paused: false};
  }else if($(this).is('.dial')){
    obj = { action: 'originate', channel: 'SIP/1000', exten: 10, context: 'from-internal',
priority : 1, async: true, callerid: '1000 VIA AMI "1000"' };
  }else if($(this).is('.logout')){
   obj = {action: 'QueueRemove', queue: '10', interface: 'sip/2000'};
  }
  now.send_data_to_asterisk(obj);
   e.preventDefault();
})


                           github.com/danjenkins/astricon-2012
Questions?
Thank You!
Dan Jenkins
     @dan_jenkins
                            Astricon 2012
                      dan.jenkins@holidayextras.com
                      hungrygeek.holidayextras.co.uk

                           npm.im/asterisk-ami
                github.com/holidayextras/node-asterisk-ami

Weitere ähnliche Inhalte

Was ist angesagt?

Reactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OReactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OArawn Park
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesLauren Yew
 
Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Visual Engineering
 
Lightning-fast Analytics for Workday transactional data
Lightning-fast Analytics for Workday transactional dataLightning-fast Analytics for Workday transactional data
Lightning-fast Analytics for Workday transactional dataPavel Hardak
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytestHector Canto
 
Caching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsCaching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsHARIHARAN ANANTHARAMAN
 
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationCQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationSamuel ROZE
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js ExpressEyal Vardi
 
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioReal Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioMindfire Solutions
 
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...ENSET, Université Hassan II Casablanca
 
How to build a chat application with react js, nodejs, and socket.io
How to build a chat application with react js, nodejs, and socket.ioHow to build a chat application with react js, nodejs, and socket.io
How to build a chat application with react js, nodejs, and socket.ioKaty Slemon
 
Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APIMario Fusco
 
GDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptxGDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptxGDSCVJTI
 

Was ist angesagt? (20)

Reactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OReactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/O
 
Celery
CeleryCelery
Celery
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
 
Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.
 
Lightning-fast Analytics for Workday transactional data
Lightning-fast Analytics for Workday transactional dataLightning-fast Analytics for Workday transactional data
Lightning-fast Analytics for Workday transactional data
 
Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytest
 
Caching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and PitfallsCaching In Java- Best Practises and Pitfalls
Caching In Java- Best Practises and Pitfalls
 
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationCQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony application
 
Cours javascript v1
Cours javascript v1Cours javascript v1
Cours javascript v1
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioReal Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
 
Node js
Node jsNode js
Node js
 
JavaScript Promises
JavaScript PromisesJavaScript Promises
JavaScript Promises
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
NFV Open Source projects
NFV Open Source projectsNFV Open Source projects
NFV Open Source projects
 
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...Mohamed youssfi support architectures logicielles distribuées basées sue les ...
Mohamed youssfi support architectures logicielles distribuées basées sue les ...
 
How to build a chat application with react js, nodejs, and socket.io
How to build a chat application with react js, nodejs, and socket.ioHow to build a chat application with react js, nodejs, and socket.io
How to build a chat application with react js, nodejs, and socket.io
 
Automated UI Testing
Automated UI TestingAutomated UI Testing
Automated UI Testing
 
Let's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java APILet's make a contract: the art of designing a Java API
Let's make a contract: the art of designing a Java API
 
GDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptxGDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptx
 

Andere mochten auch

Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIMarcelo Gornstein
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskMoises Silva
 
WebRTC & Asterisk 11
WebRTC & Asterisk 11WebRTC & Asterisk 11
WebRTC & Asterisk 11Sanjay Willie
 
Getting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceGetting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceDan Jenkins
 
WebRTC From Asterisk to Headline - MoNage
WebRTC From Asterisk to Headline - MoNageWebRTC From Asterisk to Headline - MoNage
WebRTC From Asterisk to Headline - MoNageChad Hart
 
6 Months with WebRTC
6 Months with WebRTC6 Months with WebRTC
6 Months with WebRTCArin Sime
 
WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)
WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)
WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)Victor Pascual Ávila
 
AstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it BreaksAstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it BreaksMojo Lingo
 
AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...
AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...
AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...Nome Sobrenome
 
Exploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCExploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCGrgur Grisogono
 
How to set your ADI business profile
How to set your ADI business profileHow to set your ADI business profile
How to set your ADI business profileRoadio
 
Get to know Holiday Extras 2011
Get to know Holiday Extras 2011Get to know Holiday Extras 2011
Get to know Holiday Extras 2011Matthew Pack
 
Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Developmentthedumbterminal
 
Exploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny TongExploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny TongFuture Insights
 
Scottish Communicators Network - 22 October 2014 - People Make Glasgow
Scottish Communicators Network - 22 October 2014 - People Make GlasgowScottish Communicators Network - 22 October 2014 - People Make Glasgow
Scottish Communicators Network - 22 October 2014 - People Make GlasgowJane Robson
 
Polyglot polywhat polywhy
Polyglot polywhat polywhyPolyglot polywhat polywhy
Polyglot polywhat polywhythedumbterminal
 
How to get started with Roadio in under 60 seconds
How to get started with Roadio in under 60 secondsHow to get started with Roadio in under 60 seconds
How to get started with Roadio in under 60 secondsRoadio
 

Andere mochten auch (20)

Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
 
Implementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in AsteriskImplementation Lessons using WebRTC in Asterisk
Implementation Lessons using WebRTC in Asterisk
 
WebRTC & Asterisk 11
WebRTC & Asterisk 11WebRTC & Asterisk 11
WebRTC & Asterisk 11
 
Getting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceGetting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackference
 
WebRTC From Asterisk to Headline - MoNage
WebRTC From Asterisk to Headline - MoNageWebRTC From Asterisk to Headline - MoNage
WebRTC From Asterisk to Headline - MoNage
 
6 Months with WebRTC
6 Months with WebRTC6 Months with WebRTC
6 Months with WebRTC
 
WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)
WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)
WebRTC and VoIP: bridging the gap (Kamailio world conference 2013)
 
AstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it BreaksAstriCon 2015: WebRTC: How it Works, and How it Breaks
AstriCon 2015: WebRTC: How it Works, and How it Breaks
 
AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...
AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...
AstriCon 2016 - Using Asterisk and XMPP to provide greater tools to your cust...
 
Kamailio - SIP Servers Everywhere
Kamailio - SIP Servers EverywhereKamailio - SIP Servers Everywhere
Kamailio - SIP Servers Everywhere
 
Exploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTCExploring the Possibilities of Sencha and WebRTC
Exploring the Possibilities of Sencha and WebRTC
 
How to set your ADI business profile
How to set your ADI business profileHow to set your ADI business profile
How to set your ADI business profile
 
Get to know Holiday Extras 2011
Get to know Holiday Extras 2011Get to know Holiday Extras 2011
Get to know Holiday Extras 2011
 
Holiday Extras
Holiday ExtrasHoliday Extras
Holiday Extras
 
Break away old
Break away oldBreak away old
Break away old
 
Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Development
 
Exploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny TongExploring Open Date with BigQuery: Jenny Tong
Exploring Open Date with BigQuery: Jenny Tong
 
Scottish Communicators Network - 22 October 2014 - People Make Glasgow
Scottish Communicators Network - 22 October 2014 - People Make GlasgowScottish Communicators Network - 22 October 2014 - People Make Glasgow
Scottish Communicators Network - 22 October 2014 - People Make Glasgow
 
Polyglot polywhat polywhy
Polyglot polywhat polywhyPolyglot polywhat polywhy
Polyglot polywhat polywhy
 
How to get started with Roadio in under 60 seconds
How to get started with Roadio in under 60 secondsHow to get started with Roadio in under 60 seconds
How to get started with Roadio in under 60 seconds
 

Ähnlich wie Asterisk, HTML5 and NodeJS; endless possibilities

Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the ServerDavid Ruiz
 
Introducing to node.js
Introducing to node.jsIntroducing to node.js
Introducing to node.jsJeongHun Byeon
 
CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...
CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...
CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...Amazon Web Services
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
Cloud Security @ Netflix
Cloud Security @ NetflixCloud Security @ Netflix
Cloud Security @ NetflixJason Chan
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationBen Hall
 
Leveraging the azure cloud for your mobile apps
Leveraging the azure cloud for your mobile appsLeveraging the azure cloud for your mobile apps
Leveraging the azure cloud for your mobile appsMarcel de Vries
 
How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...
How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...
How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...Matt Spradley
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchMongoDB
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiJackson Tian
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.jsguileen
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchMongoDB
 

Ähnlich wie Asterisk, HTML5 and NodeJS; endless possibilities (20)

What Is Happening At The Edge
What Is Happening At The EdgeWhat Is Happening At The Edge
What Is Happening At The Edge
 
Node azure
Node azureNode azure
Node azure
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Server
 
Introducing to node.js
Introducing to node.jsIntroducing to node.js
Introducing to node.js
 
CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...
CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...
CTD307_Case Study How Mobile Device Service Company Asurion Architected Its A...
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Cloud Security @ Netflix
Cloud Security @ NetflixCloud Security @ Netflix
Cloud Security @ Netflix
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
Leveraging the azure cloud for your mobile apps
Leveraging the azure cloud for your mobile appsLeveraging the azure cloud for your mobile apps
Leveraging the azure cloud for your mobile apps
 
How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...
How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...
How We Built a Mobile Electronic Health Record App Using Xamarin, Angular, an...
 
Node.JS briefly introduced
Node.JS briefly introducedNode.JS briefly introduced
Node.JS briefly introduced
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
IoT-javascript-2019-fosdem
IoT-javascript-2019-fosdemIoT-javascript-2019-fosdem
IoT-javascript-2019-fosdem
 
NodeJS
NodeJSNodeJS
NodeJS
 
Tutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB StitchTutorial: Building Your First App with MongoDB Stitch
Tutorial: Building Your First App with MongoDB Stitch
 

Mehr von Dan Jenkins

Yup... WebRTC Still Sucks
Yup... WebRTC Still SucksYup... WebRTC Still Sucks
Yup... WebRTC Still SucksDan Jenkins
 
Professional AV with WebRTC
Professional AV with WebRTCProfessional AV with WebRTC
Professional AV with WebRTCDan Jenkins
 
Getting started with WebRTC
Getting started with WebRTCGetting started with WebRTC
Getting started with WebRTCDan Jenkins
 
JanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTCJanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTCDan Jenkins
 
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoGetting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoDan Jenkins
 
Astricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionAstricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionDan Jenkins
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserDan Jenkins
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserDan Jenkins
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016Dan Jenkins
 
Web technology is getting physical, join the journey
Web technology is getting physical, join the journeyWeb technology is getting physical, join the journey
Web technology is getting physical, join the journeyDan Jenkins
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationDan Jenkins
 
Building the Best Experience for Your Customers and Your Business
Building the Best Experience for Your Customers and Your BusinessBuilding the Best Experience for Your Customers and Your Business
Building the Best Experience for Your Customers and Your BusinessDan Jenkins
 
WebRTC Reborn - Full Stack Toronto
WebRTC Reborn -  Full Stack TorontoWebRTC Reborn -  Full Stack Toronto
WebRTC Reborn - Full Stack TorontoDan Jenkins
 
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitWebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitDan Jenkins
 
WebRTC Reborn - Full Stack
WebRTC Reborn  - Full StackWebRTC Reborn  - Full Stack
WebRTC Reborn - Full StackDan Jenkins
 
Developing Yourself for Industry - University of Kent EDA MTD DA
Developing Yourself for Industry - University of Kent EDA MTD DADeveloping Yourself for Industry - University of Kent EDA MTD DA
Developing Yourself for Industry - University of Kent EDA MTD DADan Jenkins
 
Building 21st Century Contact Centre Applications
Building 21st Century Contact Centre ApplicationsBuilding 21st Century Contact Centre Applications
Building 21st Century Contact Centre ApplicationsDan Jenkins
 
WebRTC Reborn Hackference
WebRTC Reborn HackferenceWebRTC Reborn Hackference
WebRTC Reborn HackferenceDan Jenkins
 
WebRTC Reborn Over The Air
WebRTC Reborn Over The AirWebRTC Reborn Over The Air
WebRTC Reborn Over The AirDan Jenkins
 

Mehr von Dan Jenkins (20)

Yup... WebRTC Still Sucks
Yup... WebRTC Still SucksYup... WebRTC Still Sucks
Yup... WebRTC Still Sucks
 
Professional AV with WebRTC
Professional AV with WebRTCProfessional AV with WebRTC
Professional AV with WebRTC
 
SIMCON 3
SIMCON 3SIMCON 3
SIMCON 3
 
Getting started with WebRTC
Getting started with WebRTCGetting started with WebRTC
Getting started with WebRTC
 
JanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTCJanusCon - Building Native Mobile Apps with WebRTC
JanusCon - Building Native Mobile Apps with WebRTC
 
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoGetting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
 
Astricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and ProductionAstricon 2016 - Scaling ARI and Production
Astricon 2016 - Scaling ARI and Production
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browser
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browser
 
WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016WebRTC Reborn SignalConf 2016
WebRTC Reborn SignalConf 2016
 
Web technology is getting physical, join the journey
Web technology is getting physical, join the journeyWeb technology is getting physical, join the journey
Web technology is getting physical, join the journey
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
 
Building the Best Experience for Your Customers and Your Business
Building the Best Experience for Your Customers and Your BusinessBuilding the Best Experience for Your Customers and Your Business
Building the Best Experience for Your Customers and Your Business
 
WebRTC Reborn - Full Stack Toronto
WebRTC Reborn -  Full Stack TorontoWebRTC Reborn -  Full Stack Toronto
WebRTC Reborn - Full Stack Toronto
 
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC SummitWebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Cloud Expo / WebRTC Summit
 
WebRTC Reborn - Full Stack
WebRTC Reborn  - Full StackWebRTC Reborn  - Full Stack
WebRTC Reborn - Full Stack
 
Developing Yourself for Industry - University of Kent EDA MTD DA
Developing Yourself for Industry - University of Kent EDA MTD DADeveloping Yourself for Industry - University of Kent EDA MTD DA
Developing Yourself for Industry - University of Kent EDA MTD DA
 
Building 21st Century Contact Centre Applications
Building 21st Century Contact Centre ApplicationsBuilding 21st Century Contact Centre Applications
Building 21st Century Contact Centre Applications
 
WebRTC Reborn Hackference
WebRTC Reborn HackferenceWebRTC Reborn Hackference
WebRTC Reborn Hackference
 
WebRTC Reborn Over The Air
WebRTC Reborn Over The AirWebRTC Reborn Over The Air
WebRTC Reborn Over The Air
 

Kürzlich hochgeladen

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Asterisk, HTML5 and NodeJS; endless possibilities

  • 1. Asterisk, HTML5 and NodeJS; a world of endless possibilities Dan Jenkins Astricon 2012 @dan_jenkins @holidayextras
  • 2. The next half an hour.... • Introductions • Who Holiday Extras are • HTML5 • What’s NodeJS • How we’ve used NodeJS within our production environment • Demonstration
  • 3. Who am I? el op er Dan Jenkins D ev eb neer r W ngi @dan_jenkins 2 Years S io en oIP E & V Author of Asterisk-AMI Module
  • 4. It’s in the name, we sell extras for holidays We’re partners with some big names in the UK travel industry Theme Park Breaks easyJet Legoland, Alton Towers to name just a few British Airways Thomas Cook Theatre Breaks
  • 5. Since moving to Asterisk, Over 800,000 calls through we’ve taken ~516,000 phone calls in our Contact Centre our Contact Centre last year We are the market leaders! We believe Holidays should be Hassle Free We’ve been using Asterisk in production since April Operate in mainland Europe too, with Holiday Extras DE We’re a 29 year old start up
  • 7. What’s so great about HTML5? Easier to iterate, there’s millions of web developers out there No extra plugins required! Faster time to launch Over 60% of users with Internet access have browsers that Make fully featured apps suppport HTML5 direct in the browser
  • 8. What can you do with HTML5? Client-side databases Get User Media (Microphone & Video) Offline Application cache Web workers (Threads) WebRTC Two way, real-time, (SIP phone in the browser) communication
  • 9. So, what’s NodeJS? “Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.”
  • 10. What have Holiday Extras done? Integrated control of the call directly into our in-house CRM system, this also allows us to look up our customer in realtime We’ve been through about 3 iterations of the integration NodeJS and HTML5 have given us the ability to do this We are able to move fast to react to the current needs of our business
  • 11. How does it all fit together? NodeJS Asterisk Server Web Sockets Asterisk-AMI TCP Socket SIP Chrome Firefox Safari + SF + SF + SF
  • 12. Now for the demo @dan_jenkins @holidayextras
  • 13. Firstly, install the module npm install asterisk-ami Prerequisite: install NodeJS first!
  • 14. Create a basic NodeJS server Output a ping response from Asterisk in the command line, from the NodeJS app
  • 15. server.js var AsteriskAmi = require('asterisk-ami'); var ami = new AsteriskAmi( { host: '172.16.172.130', username: 'astricon', password: 'secret' } ); ami.on('ami_data', function(data){   console.log('AMI DATA', data); }); ami.connect(function(response){   console.log('connected to the AMI');   setInterval(function(){     ami.send({action: 'Ping'});//run a callback event when we have connected to the socket   }, 2000); }); process.on('SIGINT', function () {   ami.disconnect(); " process.exit(0); }); github.com/danjenkins/astricon-2012
  • 16. Time to step it up a notch, let’s make it output to a webpage Output that same ping response to a browser, using NodeJS
  • 17. server.js var AsteriskAmi = require('asterisk-ami'); var nowjs = require("now"); var fs = require('fs'); var express = require('express'); var http = require('http'); var ami = new AsteriskAmi( { host: '172.16.172.130', username: 'astricon', password: 'secret' } ); var app = express(); var server = http.createServer(app).listen(8080, function(){   console.log('listening on http://localhost:8080'); }); app.configure(function(){   app.use("/assets", express.static(__dirname + '/assets')); }); github.com/danjenkins/astricon-2012
  • 18. app.use(express.errorHandler()); app.get('/', function(req, res) {   var stream = fs.createReadStream(__dirname + '/webpage.html');   stream.on('error', function (err) {       res.statusCode = 500;       res.end(String(err));   });   stream.pipe(res); }) var everyone = nowjs.initialize(server); ami.on('ami_data', function(data){   if(everyone.now.echoAsteriskData instanceof Function){     everyone.now.echoAsteriskData(data);   } }); github.com/danjenkins/astricon-2012
  • 19. ami.connect(function(response){   console.log('connected to the AMI');   setInterval(function(){     ami.send({action: 'Ping'});//run a callback event when we have connected to the socket   }, 2000); }); process.on('SIGINT', function () {   ami.disconnect();   process.exit(0); }); github.com/danjenkins/astricon-2012
  • 20. webpage.html <script type="text/javascript" src="/nowjs/now.js"></script> <script type="text/javascript"> var output = function(data){   var html = '<div>' + (data instanceof Object ? JSON.stringify(data) : data) + '</div>';   var div = document.getElementById('output');    div.innerHTML = html + div.innerHTML;   }   now.echoAsteriskData = function(data){    output(data);   }   now.ready(function(){     output('connected via nowjs');   }); </script> github.com/danjenkins/astricon-2012
  • 21. Now, let’s create a call from the webpage via Bria - Asterisk 11 - SIP Phone Let’s make the browser do something, make it create a call between two sip extensions
  • 22. server.js +everyone.now.send_data_to_asterisk = function(data){ +  console.log('got data from browser', data); +  ami.send(data); +} github.com/danjenkins/astricon-2012
  • 23. webpage.html $('.btn').click(function(e){ var obj = {};   if($(this).is('.help')){    obj = {action: 'ListCommands'};   }else if($(this).is('.reload')){     obj = {action: 'reload'};   }else if($(this).is('.login')){     obj = {action: 'QueueAdd', queue: '10', interface: 'sip/2000', penalty: 1, paused: true};   }else if($(this).is('.unpause')){     obj = {action: 'QueuePause', queue: '10', interface: 'sip/2000', paused: false};   }else if($(this).is('.dial')){     obj = { action: 'originate', channel: 'SIP/1000', exten: 10, context: 'from-internal', priority : 1, async: true, callerid: '1000 VIA AMI "1000"' };   }else if($(this).is('.logout')){    obj = {action: 'QueueRemove', queue: '10', interface: 'sip/2000'};   }   now.send_data_to_asterisk(obj); e.preventDefault(); }) github.com/danjenkins/astricon-2012
  • 25. Thank You! Dan Jenkins @dan_jenkins Astricon 2012 dan.jenkins@holidayextras.com hungrygeek.holidayextras.co.uk npm.im/asterisk-ami github.com/holidayextras/node-asterisk-ami