Open Phone Abstraction Library - PowerPoint PPT Presentation

About This Presentation
Title:

Open Phone Abstraction Library

Description:

Open Phone Abstraction Library. The many colours of OPAL ... C API serialisation. Multi-purpose. Soft Phones. Handsets. Gateways. Soft PBX. Voice/Video Mail ... – PowerPoint PPT presentation

Number of Views:352
Avg rating:3.0/5.0
Slides: 68
Provided by: rjj6
Category:

less

Transcript and Presenter's Notes

Title: Open Phone Abstraction Library


1
Open Phone Abstraction Library
  • The many colours of OPAL

3rd August 2009Robert Jongbloed
2
Introduction
  • Open
  • Phone
  • Abstraction
  • Library

3
Many colours
  • Multi-platform
  • Multi-protocol
  • Multi-media
  • Multi-threaded
  • Multi-purpose

4
Multi-platform
  • Windows variants - Win2000 and up
  • Windows Mobile (aka WinCE)
  • Linux variants
  • Embedded (cross compiled) Linux
  • Mac OS X
  • Solaris
  • VxWorks

5
Multi-protocol
  • H.323
  • SIP
  • IAX2
  • Line Interfaces PSTN
  • IVR (VXML)
  • Jingle (Real Soon Now)
  • User defined

6
Multi-media
  • Audio - narrowband
  • Audio - wideband
  • Video
  • Fax
  • Instant Messaging
  • User defined

7
Multi-threaded
  • Utilises multi-core CPUs
  • Thread per I/O
  • Scalability issues
  • Synchronisation issues
  • TANSTAAFL
  • C API serialisation

8
Multi-purpose
  • Soft Phones
  • Handsets
  • Gateways
  • Soft PBX
  • Voice/Video Mail
  • Conferencing servers (MCU)

9
History
  • 1993 PWLib

10
History
  • 1993 PWLib
  • 1997 FireDoor

11
History
  • 1993 PWLib
  • 1997 FireDoor
  • NetMeeting please?

12
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler

13
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH

14
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH
  • But what about incoming calls?

15
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH
  • 1999 OpenH323

16
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH
  • 1999 OpenH323
  • Why Open Source?

17
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH
  • 1999 OpenH323
  • But what about SIP?

18
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH
  • 1999 OpenH323
  • 2001 OPAL

19
History
  • 1993 PWLib
  • 1997 FireDoor
  • 1998 ASN compiler
  • 1998 PhonePATCH
  • 1999 OpenH323
  • 2001 OPAL
  • 2006 Fork!

20
Overview
  • Object Oriented design
  • C Classes
  • C API
  • Doxygen

User
API
Codec
SIP
IAX2
H.323
OS
RTP
H/W
21
C API
  • Four functions
  • Initialise
  • Shutdown
  • SendMessage
  • GetMessage
  • Simplified model
  • Limited customisation

22
Sub-systems
  • PTLib
  • Protocol handlers
  • Transport handlers
  • Media handlers
  • Addressing/Routing
  • Media Format management
  • Codec management

23
PTLib
  • Operating System abstraction
  • Files/Directories
  • Threads/Synchronisation
  • Audio
  • Video
  • Configuration files
  • Daemons/Services
  • etc

24
PTLib
  • Operating System abstraction
  • Pool of basic code
  • Containers (lists, arrays, strings)
  • Safe containers
  • I/O Channels
  • Trace logging
  • Memory leak checking
  • etc

25
PTLib
  • Operating System abstraction
  • Pool of basic code
  • Components
  • HTTP Client/Server
  • XMLRPC/SOAP
  • VXML
  • etc

26
PTLib
  • Operating System abstraction
  • Pool of basic code
  • Components
  • C wrappers
  • Expat
  • OpenSSL
  • ODBC
  • SDL
  • etc

27
Protocol Handlers
  • H.323
  • SIP
  • IAX2
  • Line Interface Device (PSTN)
  • IVR/VXML
  • PC Sound Card/USB
  • Local

28
Transport Handlers
  • UDP
  • TCP
  • TLS
  • IPv6

29
Media Handlers
  • Stream based
  • Source in format A
  • Sink in format B
  • With or without transcoding
  • With or without threads

30
Media Formats
  • Normalisation
  • Unique name - G.729
  • Started with fixed number of options
  • Frame time
  • Bit rate
  • etc

31
Media Formats
  • Normalisation
  • Unique name - G.729
  • Started with fixed number of options
  • Frame time
  • Bit rate
  • etc
  • G.723.1-6k3, G.723.1-5k3

32
Media Formats
  • Normalisation
  • Unique name - G.729
  • Started with fixed number of options
  • Frame time
  • Bit rate
  • etc
  • G.723.1-6k3, G.723.1-5k3
  • Video has explosion of options

33
Media Formats
  • List of options
  • Custom
  • Normalised
  • Media format negotiation (merging)
  • Customisation/Normalisation functions

34
Codec Management
  • Multi-stage format matching
  • No conversion necessary
  • Get from A to B direct
  • Get from A to B via C

35
Codec Management
  • Multi-stage format matching
  • RTP frame as common format

36
Codec Management
  • Multi-stage format matching
  • RTP frame as common format
  • OpalTranscoder
  • Converts one format to another
  • Single frame in
  • 0, 1 or many frames out

37
Codec Management
  • Multi-stage format matching
  • RTP frame as common format
  • OpalTranscoder
  • Directly linked or Plug-ins

38
Codec Plug-ins
  • DLL/.so files
  • Loaded at run time
  • Currently on application start
  • Relatively simple C API
  • Two functions GetVersion, GetCodecs
  • Tables
  • Call back functions

39
Class Hierarchy
OpalManager
OpalEndPoint
OpalCall
OpalSIPEndPoint
OpalLineEndPoint
OpalConnection
OpalMediaPatch
OpalSIPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
OpalUDPTransport
OpalTCPTransport
RTPSession
RTP_UDP
40
Listening State
OpalManager
OpalEndPoint
OpalLineEndPoint
OpalRTPEndPoint
OpalPCSSEndPoint
OpalIVREndPoint
OpalIAX2EndPoint
OpalLocalEndPoint
OpalSIPEndPoint
OpalH323EndPoint
OpalLineInterfaceDevice
OpalListener
OpalUDPListener
OpalTCPListener
41
Call State
OpalManager
OpalCall
OpalEndPoint
OpalConnection
OpalRTPConnection
OpalPCSSConnection
OpalIVRConnection
OpalIAX2Connection
OpalLocalConnection
OpalLineConnection
OpalSIPEndPoint
OpalH323EndPoint
OpalVXMLSession
OpalLine
OpalTransport
OpalLineInterfaceDevice
OpalUDPTransport
OpalTCPTransport
42
Media Flow
OpalConnection
OpalMediaPatch
PThread
OpalMediaStream
OpalAudioMediaStream
OpalIVRMediaStream
OpalIAX2MediaStream
OpalLocalMediaStream
OpalLineMediaStream
OpalRTPMediaStream
OpalVXMLSession
PSoundChannel
OpalLine
RTPSession
OpalLineInterfaceDevice
43
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
TCP SYN
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
44
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
Incoming
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
45
Anatomy of a Call
OpalManager
CreateCall
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
46
Anatomy of a Call
OpalManager
CreateConnection
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
47
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
CreateTransport
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
48
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
ReadSetup/INVITE
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
49
Anatomy of a Call
OpalManager
RouteCall
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
50
Anatomy of a Call
OpalManager
CreateConnection
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
51
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
Ring
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
52
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
Alerting/180
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
53
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
Pick Up
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
54
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
CreateMedia
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
55
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
CreateMedia
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
56
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
CreatePatch
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
57
Anatomy of a Call
OpalManager
OpalEndPoint
OpalCall
OpalRTPEndPoint
OpalLineEndPoint
OpalConnection
OpalLineInterfaceDevice
OpalMediaPatch
OpalRTPConnection
OpalLineConnection
OpalListener
Connect/200
OpalMediaStream
OpalLine
OpalUDPListener
OpalTCPListener
OpalRTPMediaStream
OpalLineMediaStream
OpalTransport
RTPSession
OpalLine
OpalUDPTransport
OpalTCPTransport
RTP_UDP
58
Sample Code
  • class MinOPAL public PProcess
  • public
  • MinOPAL()
  • MinOPAL()
  • virtual void Main()
  • private
  • MyManager m_manager

59
Sample Code
  • class MyManager public OpalManager
  • public
  • virtual void OnClearedCall(
  • OpalCall call ///lt Connection that was
    established
  • )
  • PSyncPoint m_completed

60
Sample Code
  • class MyLocalEndPoint public OpalLocalEndPoint
  • public
  • virtual bool OnReadMediaFrame(
  • const OpalLocalConnection connection,
    ///lt Connection for media
  • const OpalMediaStream mediaStream,
    ///lt Media stream data
  • RTP_DataFrame frame
    ///lt RTP frame for data
  • )
  • virtual bool OnWriteMediaFrame(
  • const OpalLocalConnection connection,
    ///lt Connection for media
  • const OpalMediaStream mediaStream,
    ///lt Media stream data
  • RTP_DataFrame frame
    ///lt RTP frame for data
  • )

61
Sample Code
  • m_manager new MyManager()
  • SIPEndPoint sip new SIPEndPoint(m_manager)
  • if (!sip-gtStartListeners(PStringArray()))
  • cerr ltlt "Could not start default SIP
    listeners." ltlt endl
  • return
  • H323EndPoint h323 new H323EndPoint(m_manage
    r)
  • if (!h323-gtStartListeners(PStringArray()))
  • cerr ltlt "Could not start default H.323
    listeners." ltlt endl
  • return
  • new MyLocalEndPoint(m_manager, args0,
    args1)

62
Sample Code
  • // Route SIP/H.323 calls to the T38 endpoint
  • m_manager-gtAddRouteEntry("sip.. local")
  • m_manager-gtAddRouteEntry("h323.. local")
  • // If no explicit protocol on URI, then send to
    SIP.
  • m_manager-gtAddRouteEntry("local.
    sipltdagt")
  • m_manager-gtSetUpCall("local", args2, token)

63
Applications
  • SimpleOPAL
  • OpenPhone
  • faxopal
  • ivropal
  • mcuopal
  • opalgw

64
Whats been done
  • Ekiga
  • Skype Gateway
  • Seminar broadcasting
  • Windows Mobile handset client
  • Dealer trading room
  • ADSL modem
  • Who knows?

65
FreeSWITCH
  • mod_opal
  • H.323
  • IAX2
  • SIP?

66
Future?
  • Fax via libspandsp
  • Enhance Instant Messaging
  • Presence
  • Innumerable random RFCs
  • Whatever someone pays us to do!

67
Thank You
  • Something for everyone
  • www.opalvoip.org
  • Questions?
Write a Comment
User Comments (0)
About PowerShow.com