RestComm Architecture Design

Post on 27-Jan-2017

595 views 0 download

Transcript of RestComm Architecture Design

Restcomm Architecture & Designfor new developers

Contents

● About the project

● RCML (Restcomm Markup Language)

● RVD (Restcomm Visual Designer)

● Restcomm REST APIs

● Restcomm Core

○ Service plugins

○ Extensions

○ Interpreters

What is Restcomm?

" Restcomm is a next generation cloud communications platform to rapidly build voice, video, and messaging applications, using mainstream development skills. "

About the project

Management and distribution technologies

GitHub Link

CloudBees Link

Docker Link

Restcomm's ecosystem

Uses Restcomm

Used by Restcomm

RCML

The Restcomm Markup Language (RCML) is composed of a set of XML tags that can be used to instruct Restcomm on how to handle an on-going phone call.

How?

The tags that composes the RCML are named as verbs and nouns, the combination between these elements form the path followed by Restcomm during the call.

RCML

Examples:

<Response><Say>Hello World</Say>

</Response>

<Response><Dial>

<Client>bob</Client></Dial>

</Response>

verbs: Sayverbs: Dial

nouns: Client

RCML

Examples:

<Response><Gather action="handle-user-input.php" numDigits="1">

<Say>Welcome to TPS.</Say><Say>For store hours, press 1.</Say><Say>To speak to an agent, press 2.</Say><Say>To check your package status, press

3.</Say></Gather><!-- If customer doesn't input anything, prompt and try again.

--><Say>Sorry, I didn't get your response.</Say>

<Redirect>handle-incoming-call.xml</Redirect> </Response>

For more info about RCML: http://docs.telestax.com/restcomm-pages/

RVD

RVD (Restcomm Visual Designer) is a Restcomm resource that allows us to create and edit RCML applications using graphical user interface components.

Features:

● drag & drop verbs and nouns to build RCML applications;

● manage audio resources and modules;

● provide the RCML on demand to Restcomm;

● import and export projects, and more.

RVD

<Response><Say>Hello World</Say>

</Response>

Corresponding RCMLApplication created using RVD

RVD

<Response><Dial>

<Client>bob</Client></Dial>

</Response>

Application created using RVD Corresponding RCML

RVD

Example of a call flow to an application

Restcomm REST APIs

Restcomm Restful APIs is a set of web service endpoints that allows us to manage and use Restcomm resources through the standard HTTP methods.

Features:

● create, read, update and delete accounts, phone numbers, calls, text messages, recordings, etc;

● create and control Voice, SMS and USSD sessions (start a new call, send a new sms message, etc);

● access secured by authentication, HTTPS protocol and Multi-tenancy control

Restcomm REST APIs

Some of the available endpoints

AccountAvailablePhoneNumbersCallsClientsGatewayIncomingPhoneNumbersNotifications

OutboundProxyRecordingsSMS MessagesTranscriptionsUsage RecordsUssdPush

For more info about available endpoints: http://docs.telestax.com/restcomm-pages/

Restcomm REST APIs

Accessing Accounts list endpoint, using HTTP GET method

URL description: http://127.0.0.1:8080/restcomm/2012-04-24/Accounts.json

Browser access: use login credentials (email / password)

cURL access: use Account SID and Auth Token

Server address

Context name

API version Endpoint name

Response format (default XML if omitted)

Restcomm REST APIs

Accessing Accounts list endpoint, using HTTP GET method

JSON XML

Restcomm REST APIs

Simple access diagram

Restcomm REST APIs

Multi-tenancy

Primary Account can view and manage Application P, DID P, DID A and DID B only.Subaccount A can view and manage Application A and DID A only.Subaccount B can view and manage Application B and DID B only.Secondary Account can view and manage Application S, DID S, DID C and DID D only.Subaccount C can view and manage Application C and DID C only.Subaccount D can view and manage Application D and DID D only.

Restcomm REST APIs

Hints for the development of a new endpoint

● consult an existing endpoint (like ClientsEndpoint) and use it as reference;● always check the need of authentication and multi-tenancy;● create unit / integration tests to finish with development.

Restcomm REST APIs

Guidelines to the development of a new endpoint

Description about previous slide

AbstractEndpoint: holds the common structure used by all endpointsClientsEndpoint: implementation of the endpoint logicClientsXmlEndpoint: link the HTTP methods with endpoint logic through XMLClientsJsonEndpoint: link the HTTP methods with endpoint logic through JSONAbstractConverter: holds the common structure to build all responsesClientConverter: implementation to create specific JSON and XML responsesClientsDao: interface to access and interact with MyBatis database layer

Restcomm REST APIs

Restcomm Core: Service Plugins

Service plugins are the way to implement services for the Restcomm core.

How?

● Restcomm core defines HOW a service is used inside the platform

● the service represents, in a generic way, the scope and domain of a resource

● the API defines the contract to be implemented.

● the plugin implements a specific derivation of the service known by Restcomm core

Restcomm Core: Service Plugins

Example

Service: TTS (Text-to-speech)

API: restcomm.tts.api (name of the Maven module that represents the API)

Plugin: restcomm.tts.voicerss (name of the Maven module that represents the VoiceRSS TTS plugin)

Restcomm Core: Service Plugins

Restcomm Core: Service Plugins

Guidelines to the development of a new Plugin

● understand how the service works (its scope and domain inside Restcomm);

● know the resources available through the API;

● create a new Maven module (name pattern: restcomm.{servicename}.{pluginname});

● have fun developing;

● create unit / integration tests to finish development.

Restcomm Core: Extensions

Extend restcomm functionality without the need to know Restcomm core internals.Restcomm will dynamically load available extensions in the classpath and execute them on a pre defined injection points.

Examples of extensions:● Traffic throttling● Least cost routing● Applications update● Dial plan

● Abbreviated dialing● Charging

Restcomm Core: Extensions

Restcomm Core: Interpreters

Interpreter is the component that translates RCML into telecom protocols. Interpreters will get the RCML for a given application, interpret it and execute it.

Features:

● different interpreter according to the session (Call, SMS, USSD);

● allow users to focus on the business logic using RCML instead of spending time with telco protocols;

Restcomm Core: Interpreters

Examples:

● Voice Interpreter

● SMS Interpreter

● USSD Interpreter

<Response><Say>Hello World</Say>

</Response>

Voice Interpreter

"Hello World"

Thank you!Guilherme Humberto Jansen

guilherme.jansen@telestax.com