Developing GNU Bayonne 2

ClueCon Telephony Expo & Developers Conference 2005

David Sugar, GNU Project

http://www.gnutelephony.org/clue2005

ClueCon Telephony Expo & Developers Conference 2005

Developing GNU Bayonne Overview

Project History and Background:

* Introduction to GNU Telephony

* What is GNU Bayonne and how is it used?

* History and development of GNU Bayonne as a FS/OS project

* What I learned from developing Bayonne

* Problems and Introduction of Second Generation Server

Bayonne 2 Architecture in depth:

* Overview of Bayonne 2 Architecture

* Life cycle of a Call Session and Scripting Engine

* Libexec, phrasebook, Continues Audio Processing, and Server

Personalities in Bayonne 2

Bayonne 2 in Enterprise and Server Provider Telephony:

* Integrating Bayonne 2 with GNU Enterprise and web based groupware

* Carrier hosted messaging and debit card calling

* Virtual call centers, and other ideas

* Future Directions for Bayonne 2 and Embedded work

ClueCon Telephony Expo & Developers Conference 2005

Introduction to GNU Telephony

What we try to do differently:

* Separate functional roles, replacable components

* Externalize meta-data such as subscribers and routes

* Common administration and control of components

* Integrate with API's for telephony hardware

* Minimize audio processing and conversions

* Use traffic engineered scripting engine for appservers

* Apply free software compatible licensing everywhere

* Closely integrate with other projects (gnue, phpgw)

Web & Meta

Call Server

App Server

Gateway

User

Realtime

Management

ClueCon Telephony Expo & Developers Conference 2005

What is Bayonne & How is it used?

* Free software for computer telephony

* Bayonne as a computer telephony toolkit

* Corner cases and Market Nitches

* Bayonne as a script driven and hosted IVR

* Embedded adjuncts and Legacy Integration.

* High port count applications; IDT Debit

* IVR as a network service; CRM Surveys

* Provides voice application services for users!

Port density

High Cap.

Bayonne

Embedded.

Bayonne

Community

Asterisk,

?Yate?

ClueCon Telephony Expo & Developers Conference 2005

From Concept to Production Release

1991	Year of Linux Kernel,

I was doing QNX call servers

1997	DBS Server on GNU/Linux

CTI as Free Software!

1999	year of OpenH323 and also ACS; C++ everywhere!

2001	Transition to Bayonne

and mature libraries

* Clear articulated design

* Building upon past work

* Why we choose C++

* Massive Scalability & threading

* Logical breakdown of coding

* Why free software licensing & Community?

1995	U.S. Federal Govt telecom

infrastructure goes (gnu/)Linux!

2004	First FS/OS Telephony conference (in Germany)!

sip/h323 drivers in Bayonne

2005 Bayonne 2 introduced for GNU/Linux, xBSD, Mac

OS/X and Microsoft Windows

2000 Asterisk 0.1 released??

Quicknet and /dev/phone?

2003 YATE PBX architecture discussed and planned

ClueCon Telephony Expo & Developers Conference 2005

Dividing up the puzzle

* Large project as a whole of interest to very small number of people

* Finding parts of a project that have wider interest and spinning those off into separate packages.

* Separate packages means separate and simplified component debugging.

* Large projects already often depend on other external packages so additional dependencies that are locally controlled does not add to complexity.

How we originally divided Bayonne Component Packages:

* GNU Common C++ - core C++ threading, sockets, etc

* GNU ccAudio - C++ audio manipulation

* GNU ccScript - inheritable script engine and wrapper executive

* GNU ccRTP - high performance rtp protocol library

* GNU Bayonne – application server

ClueCon Telephony Expo & Developers Conference 2005

Where things went wrong

Many concurrent project trees after 5 years:

* Production branch, used worldwide, limited changes over time

* “Stable” Branch; OST Development

* Individual per customer branches

* “testing” Branch for future production releases

Problems in Bayonne today (many not solved in testing branch):

* Too many trees; customer branches are often changes lost

* Lack of rigorous spec for core scripting language itself

* many script side effects and script debugging issues

* Over-engineered and tuned for corner cases only

* Too many hard-coded limits

* Mission creep outside of core functionality in core package

* Driver development model very complex

* Lack of supporting gui ide and other infrastructure projects

ClueCon Telephony Expo & Developers Conference 2005

Introduction of Bayonne “2”

Key changes in Bayonne 2:

* Vastly simplified and more consistent coding for drivers

* Entirely rewritten, no legacy code from original or testing branches

* New code base vastly simplified, focuses on core functionality

* Consistent and strongly enforced scripting language spec

* Better lock-free operation of call sessions & better parallelism

* Elimination of strange hard coded limits

* Divided between Drivers, Bayonne Engine Library, and Server

* BEL absorbing common parts of driver & server functionality

* Full cross-platform porting, early testing, immediate availability on

GNU/Linux, xBSD, Mac OS/X, Solaris, AIX, and Microsoft Windows

* Support for multiple server personalities on top of BEL

How this was put together:

* Peter's proposal for a simplified server accepted in late April

* Initial simplified server and engine library development in May

* Full and early release cycle on all platforms starting in June

* A lot of key development work completed in July

* Introduction of GNU Telephony for community organization

* Commercial opportunities in the future

ClueCon Telephony Expo & Developers Conference 2005

Overview of Bayonne 2 Architecture

Component Libraries

Bayonne Engine

Library

Drivers

Plugins

Server Personality

Libexec

Management

Applications

ClueCon Telephony Expo & Developers Conference 2005

Life Cycle of a Call Session in Bayonne

Apps

Run

States

Call

Setup

Tear

Down

Idle

Offline

Key points in Bayonne:

* Each call session executes

states independently in parallel

* Resources used by call state

* Apps run only for live calls

* Stacks/card resources

minimized while idle

* Stack/RTP created/destroyed

in Setup and Teardown

* Offline for CGL hotswap

* Drivers send abstract events

How other servers do this?

* Yate optimizes msg passing

but externalizes states serially

* Asterisk I do not know...?

* Some proprietary systems like

ctade, ivs run apps continually

Driver

ClueCon Telephony Expo & Developers Conference 2005

How is this laptop configured?

Bayonne 0.7.0 SIP

sip:myscr@local:5070

sip:perl@local:5070

Myscr

registers

Partysip proxy

sip:scr@local:5060

sip:perlscr@local:5060

sip:ag@local:5060

User

Agent

x-ten

sip:ag@local:5050

Libexec Unit

Perl

script

registers

ClueCon Telephony Expo & Developers Conference 2005

Why Bayonne Scripting Engine?

Why our own traffic engineered scripting language:

* parallelism and scaling to 1000 concurrent sessions

* very tight management of cpu execution

* reduction of heap memory fragmentation

* lockfree threaded program execution

* non-blocking reload of application scripts

* scripting as server configuration language

* execution at edge of state transition & blocking

Abuse of C++ and other oddities:

* Automatic instantiation & linking of Plugins

* Abuse of ELF and pre-linking of images

* Abstraction of apps through sideway inheritence

ClueCon Telephony Expo & Developers Conference 2005

Libexec Engine and Bayonne 2 TGI

Libexec Features in Bayonne 2:

* Seperate process per call session

* Transactional session management

* Each process sends commands and receives replies

* Shared queue for sending to reduce file handle use

* Libexec modules for Perl, Python, C#, Java, and PHP

* Libexec can perform phrasebook audio sequencing

* Process Seperation and Interpreter Embedding!

#!/usr/bin/python

#bayonne: register.sip proxy=localhost uri=sip:test@localhost

from libexec import Libexec

if __name__ == '__main__':

tgi = Libexec()

tgi.echo("LIBEXEC STARTED")

result = tgi.speak("&number 123")

tgi.echo("PROMPT DONE, RESULT=%d" % result)

tgi.result(result)

file1 = tgi.pathname("tmp:edit")

file2 = tgi.pathname("temp/edit")

tgi.echo("PATHS %s and %s" % (file1, file2))

ClueCon Telephony Expo & Developers Conference 2005

Phrasebook Localization in Bayonne 2

Phrasebook Mapping:

* Sequence and order of multilingual prompts

* Maps dialects and languages with prerecorded voices

* Dialect and language isolation

* Applications written language independent

Locale

Voice

Phrases

register.sip proxy=localhost uri=sip:test@localhost

lang en fr ru

do

menudef

speak tests:num1

input %myvar count=5 timeout=5

endmenu

break #myvar < 1

play tests:num2

play &number %myvar voice=en/deborah

play tests:num3

play &number %myvar voice=fr/nicole

play tests:num4

play &number %myvar voice=ru/dmitry

loop

play tests:num5

hangup

ClueCon Telephony Expo & Developers Conference 2005

Device Drivers in Bayonne 2

Drivers in Bayonne 2:

* Voice and protocol drivers treated same

* Peering of audio streams and codec conversions

* Only driver and session class inherited, no state code

* Can be built over upper level API/SDK toolkits

* New Continues audio processing model, voice overlay,

Background music, and audio feeds

* Universal event queing and thread death management

Bayonne 2 Dialogic Driver

wc -wl *.cpp *.h

980 2306 driver.cpp

612 1235 session.cpp

168 450 driver.h

1760 3991 total

90 455 accept.cpp

107 486 answer.cpp

64 214 busy.cpp

97 287 collect.cpp

149 584 dcb.cpp

284 801 dial.cpp

793 2043 driver.cpp

124 502 flash.cpp

109 501 hangup.cpp

266 824 idle.cpp

61 412 isdn.cpp

256 755 join.cpp

215 700 play.cpp

224 743 record.cpp

82 447 reject.cpp

92 290 ringing.cpp

205 648 sleep.cpp

186 633 step.cpp

122 506 tone.cpp

1069 2437 trunk.cpp

182 646 uio.cpp

369 1114 driver.h

5146 16028 total

Original Bayonne Dialogic Driver

ClueCon Telephony Expo & Developers Conference 2005

Server Personalities and Management

Server Personalities in Bayonne 2:

* Generic script driven/libexec voice application server

* Subscriber personality for Universal Messenger

* Group call statistics/ACD agent support through

an alternate server personality

* XML call parsing through alternate personalities

* Server personality also possible through plugins

Management and Admin in Bayonne 2:

* All server personalities can broadcast common info

* Baysight console to monitor voice servers

* Admin interface to server defined through plugins

* common management for spans and call segments

XML Server

Web Server

Xml over http

Messanger

Apps

Webservice

Subscriber

Info

soap

ClueCon Telephony Expo & Developers Conference 2005

GNU Enterprise and Groupware

Bayonne Voice

Server

Phpgw/

gnue

apps

Phpgw web

services, gnue

SQL data, etc

Libexec

Wired PBX,

Olorin, SipX,

Asterisk,

or gnugk

* Generic Bayonne voice server used

* Voice apps written in php, python,

then access phpgw/gnue data and

webservices

* App specific configuration in phpgw

or gnue, web based forms

* If IP Call server used, should also be

able to get common config and user

data from gnue and/or groupware..

* Complete voice/messaging and SME

solutions bundled in a box or CD

ClueCon Telephony Expo & Developers Conference 2005

Service Provider Messaging & Debit

Bayonne

Voice Server

Voice

App

Scripts

Carrier

Switch, high

capacity call

server (ser)

* Custom server personality or server

plugin aware of subscriber and/or call

rate services

* User interactions in Bayonne Scripting

Subscriber info and

/ or rate tables, as

web service?

Public web Portal

Plugin

ClueCon Telephony Expo & Developers Conference 2005

Bayonne 2 and Virtual Call Centers

Bayonne

Voice Server

Holding

Patterns

Call Server

with virtual

call groups

Agents and Groups

Public web Portal

Plugin

* Use separate call server with agent and

call queue management, Bayonne

manages prompts and holding patterns

ClueCon Telephony Expo & Developers Conference 2005

Voice Portals and Document Browsing

Alexandria XML

Server Personality

Traditional

PBX or IP

Call Server

* Pure XML server personality

* Renders xml content as voice

* Web server side scripting can be

used to control call flow by

generating dynamic XML content

Web Server for

voice documents

Public web Portal

Daisy

Docs

Call

XML

ClueCon Telephony Expo & Developers Conference 2005

Where you can help

Component Libraries:

* GNU Common C++ Embedded Project

* ccAudio 2 – Codecs, mp3/ogg containers, full duplex and

complete audio for w32, os/x, oss, and alsa drivers

Phasebook:

* More languages and matching voice libraries

Management:

* Bayonne Management Console (baysight), integration with

SNMP and network management tools, MRTG, etc

Applications & Server Personalities:

* Complete solutions that people will want to use

* XML Services and voice services for the blind

* Troll Gateway Server and peering on top of libbayonne

Drivers:

* Drivers for more cards and protocols

ClueCon Telephony Expo & Developers Conference 2005

Concluding points about Bayonne 2

* Bayonne 2 integrates to upper level libraries, and with

simplified driver model is easily adapted to other cards

* Bayonne 2 offers library for building alternate servers

including XML, gateways, and even complete PBX's

* Multi-platform, including Posix & Microsoft Windows

* Common management framework part of library

* Bayonne 2 phrasebook and voice localization

* Bayonne 2 Application Library

* Traffic engineered scripting language and support for

over 1000 concurrent voice sessions

* Support for SIP and H323 call servers as well as

traditional PBX's, IAX2 (opal!) coming soon

ClueCon Telephony Expo & Developers Conference 2005

Additional Resources

HTTP://www.gnu.org/software/bayonne	Primary Bayonne

HTTP://www.gnue.org	GNU Enterprise

HTTP://www.gnutelephony.org	GNU Telephony

HTTP://www.gnutelephony.org/clue2005	This presentation

HTTP://www.gnu.org/software/commoncpp	Common C++ Libraries

mailto:dyfet@gnutelephony.org	Email contact

Commercial Support:

David Sugar, Tycho Softworks

Bayonne Support and Custom Telephony Solutions

Cape May Court House, NJ +1 609 465 5336

mailto:dyfet@tychosoft.com AIM: gnutelephony

David Sugar

2004-12-26T10:46:29