Asterisk based real-time social chat Advisor : Lian-Jou Tsai

advertisement
Asterisk based real-time social chat
Advisor : Lian-Jou Tsai
Student : Jhe-Yu Wu
Outline
Motivation
Abstract
Telephony Technology
Application
System Design
Conclusion
Reference
Motivation
To integrate WebRTC into SIP and PSTN.
To simplify calling process.
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.
Telephony Technology
PSTN & VoIP
PSTN
VoIP
Public Switched Telephone Network
Voice over Internet Protocol
VoIP Server
PSTN
Figure 1. The PSTN architecture.
Figure 2. The VoIP architecture.
Application
Asterisk & WebRTC
Asterisk
Asterisk is a flexible and extensible suite of integrated
telecommunications software.
WebRTC
WebRTC (Web Real Time Communication) is a open
project
that enables web browsers with
Real-Time Communications capabilities
via simple JavaScript APIs.
Supported Browsers
System Design
User interface & Core component
User Interface : jQuery
jQuery is a cross-platform JavaScript
library designed to simplify the clientside scripting of HTML.
JavaScript
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();
jQuery
$.ajax({
url: "ajax.php?data=ok",
type: "GET",
success: function(){
//ok
}
})
User Interface : JSON
JSON is an open standard format that
uses human-readable text to transmit
data objects consisting of attribute–
value pairs.
XML
<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>
JSON
{
"book": {
"type": "textbook",
"pages": "256",
"title": "Programming Pearls 2nd
Edition",
"rating": "4.5",
"coverType": "paperback",
"genre": "Computer Science",
"author": "Jon Bentley“
}
}
User Interface
jQuery
PHP
JSON
HTML
Client Side Scripting
Server Side Scripting
Javascript Object Notation
Create Web Page
Send an AJAX request to PHP
Send command to AMI and
handle returning value
Wrap returning data in JSON
Parse JSON using jQuery and
render web page
Core Component : AMI
PHP-AMI-CLASS, a PHP class for Asterisk
Manager Interface
Access AMI with simple AIPs
Available on GitHub
Core Component
JSON
Asterisk
AMI
PHP
Javascript Object Notation
VoIP Server
Asterisk Manager Interface
Server Side Scripting
Wrap returning data in JSON
Provide WebRTC service
through WebSocket
Control Asterisk by reading
or sending command to AMI
Send command to AMI and
handle returning value
Traditional Service
Brand New Social Chat
Fill lots of informations before make the call
Login with a Facebook account, no more input
Simple User Interface
Cross Platform
Chat Everywhere
The system write with native APIs, don’t
need to worry about support of other
browsers and OSes.
Advantage
No More Registration
Login with Facebook account
Chat Everywhere
Cross-platform
No Plugin Needed
Native WebRTC support
References
[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
Thanks for your patient
Download