asterisk based real-time social chat advisor : lian-jou tsai student : jhe-yu wu

20
Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Upload: tamsin-mccoy

Post on 31-Dec-2015

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Asterisk based real-time social chat

Advisor : Lian-Jou TsaiStudent : Jhe-Yu Wu

Page 2: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Outline

Motivation

Abstract

Telephony Technology

Application

System Design

Conclusion

Reference

Page 3: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Motivation

To integrate WebRTC into SIP and PSTN.

To simplify calling process.

Page 4: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Abstract

This study aims to integrate new telephony technology like WebRTC with VoIP.

The following slides will introduce telephony technology including PSTN and VoIP.

The system design will show at the end of the presentation.

Page 5: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Telephony Technology

PSTN & VoIP

Page 6: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

PSTNPublic Switched Telephone Network

VoIPVoice over Internet Protocol

Figure 1. The PSTN architecture.

PSTN

VoIP Server

Figure 2. The VoIP architecture.

Page 7: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

ApplicationAsterisk & WebRTC

Page 8: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

AsteriskAsterisk is a flexible and extensible suite

of integrated telecommunications software.

WebRTCWebRTC (Web Real Time Communication)

is a open project 

that enables web browsers withReal-Time Communications capabilities

via simple JavaScript APIs.

Supported Browsers

Page 9: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

System DesignUser interface & Core component

Page 10: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

User Interface : jQuery

jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML.

var xmlhttp;if (window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest();}else{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}xmlhttp.onreadystatechange = function(){ if (xmlhttp.status == 200){

//ok }}xmlhttp.open("GET","ajax.php?data=ok",true);xmlhttp.send();

$.ajax({ url: "ajax.php?data=ok", type: "GET", success: function(){ //ok }})

jQuery

JavaScript

Page 11: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

User Interface : JSON

JSON is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs.

<book> <type>textbook</type> <pages>256</pages> <title>Programming Pearls 2nd Edition</title> <rating>4.5</rating> <coverType>paperback</coverType> <genre>Computer Science</genre> <author>Jon Bentley</author></book>

{ "book": { "type": "textbook", "pages": "256", "title": "Programming Pearls 2nd Edition", "rating": "4.5", "coverType": "paperback", "genre": "Computer Science", "author": "Jon Bentley“ } }

XML

JSON

Page 12: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

HTMLJSONPHPjQuery

Create Web Page

Parse JSON using jQuery and render web

page

Server Side Scripting

Send command to AMI and handle returning

value

Javascript Object Notation

Wrap returning data in JSON

Client Side Scripting

Send an AJAX request to PHP

User Interface

Page 13: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Core Component : AMI

PHP-AMI-CLASS, a PHP class for Asterisk Manager Interface

Access AMI with simple AIPs

Available on GitHub

Page 14: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

PHPAMIAsteris

kJSON

Server Side Scripting

Send command to AMI and handle returning

value

VoIP Server

Provide WebRTC service through

WebSocket

Asterisk Manager Interface

Control Asterisk by reading or sending command to AMI

Javascript Object Notation

Wrap returning data in JSON

Core Component

Page 15: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Traditional Service

Fill lots of informations before make the call Login with a Facebook account, no more input

Brand New Social Chat

Page 16: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Simple User Interface

Page 17: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Cross Platform

Chat EverywhereThe system write with native APIs, don’t need to worry about support of other browsers and OSes.

Page 18: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Chat EverywhereCross-platform

No More RegistrationLogin with Facebook account

No Plugin NeededNative WebRTC support

Advantage

Page 19: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

[1] www.voip-info.org/wiki/view/Asterisk+manager+API

[2] www.oschina.net/question/100267_61459

[3] wikipedia.org/JSON

[4] stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery

[5] wikipedia.org/wiki/Jquery

References

Page 20: Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu

Thanks for your patient