run the slides
TRANSCRIPT
![Page 1: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/1.jpg)
Welcome!
Today’s Webinar: Designing VoIP Services
with PIKA Building BlocksIrene CrosbyHead of MarketingPIKA Technologies
![Page 2: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/2.jpg)
Your Webinar Leader
Yashar MoghanSenior Field Application EngineerPIKA Technologies
![Page 3: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/3.jpg)
Familiarization with MShow
• Audio streaming• Sending us questions
![Page 4: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/4.jpg)
Objectives
To present:• A technical overview of PIKA VoIP
building blocks, and• How to develop VoIP-enabled
applications using a PIKA platform
![Page 5: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/5.jpg)
• An overview of general requirements for IP-PSTN connectivity
• VoIP building blocks in MonteCarlo 6.2• G.711 and 726 codecs, RTP, jitter buffer, EC
• PIKA VoIP and related API• Integration with VoIP signaling stacks• Hardware requirements:
• PIKA MM cards plus any host NIC
• Setup tool, test and sample applications
Agenda
![Page 6: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/6.jpg)
• You have a basic technical understanding of IP / VoIP
• Ideally, you are familiar with PIKA MonteCarlo
Assumptions
![Page 7: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/7.jpg)
Jitter Buffer
RTP
RTP 001010 RTP
0010101010
Codec
01001001010101001110101
1101110101
Echo
0010101010
Codec
RTP
RTP 001010 RTP
SIP IP
PSTN/POTS PIKA APPLICATION IP
General requirements for IP-PSTN connectivity
![Page 8: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/8.jpg)
Essential building blocks in MonteCarlo 6.2
1. Readily supported IP codecsG.711, G.726
2. RTP Packet headers containing codec type and ordering info
3. Jitter bufferUses RTP information to deliver smoother /steady audio
4. Echo cancellation
All done on the DSP
![Page 9: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/9.jpg)
Essential building blocks in MC6.2
1. IP codecs• Format of Tx/Rx compressed data/audio• Compressed data = Payload• G.711 and G.726 formats are offered readily• Other codecs would be considered as needed
![Page 10: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/10.jpg)
2. RTP (Real-Time Transport Protocol)• Serves as a mechanism to tell the receiving-
end the format of the audio• Provides information to the receiving-end to
put the packets in the correct order or skip missing ones
• [RTP header + Payload] => RTP IP packet
Essential building blocks in MC6.2
![Page 11: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/11.jpg)
3. Jitter buffer mechanism • Why needed: VoIP packets do not necessarily
arrive at their destination in correct order, or at all!
• An adjustable buffer with parameters set in the API structure; i.e. size, dynamic vs. static
• Takes advantage of RTP information associated with each packet to order them correctly before delivering the audio to the near-end listener
Essential building blocks in MC6.2
![Page 12: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/12.jpg)
4. Echo Cancellation• Due to inherent delay in VoIP systems, echo
is more noticeable than in regular PSTN calls. It must be removed in most cases!
• G.168 compliant• Tail lengths from 1 to 128ms• EC mask is simply added to resMask when
seizing the RTP resource
Essential building blocks in MC6.2
![Page 13: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/13.jpg)
PIKA MonteCarlo 6.2 VoIP API: PK_VOIP_xxx
![Page 14: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/14.jpg)
VoIP API• PK_VOIP_EncodeSetParameters• PK_VOIP_EncodeGetBufferSize• PK_VOIP_EncodeAddBuffers• PK_VOIP_EncodeStart• PK_VOIP_EncodeStop
• PK_VOIP_DecodeSetParameters• PK_VOIP_DecodeGetBufferSize• PK_VOIP_DecodeStart• PK_VOIP_DecodeAddBuffers• PK_VOIP_DecodeStop
![Page 15: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/15.jpg)
VoIP API – Encode – SetParameters
• PK_VOIP_EncodeSetParameters (TResourceHandle hPort, TVOIPEncodeParameters
*encodeParams);
typedef struct{TCodecType codecType;PK_U32 payloadType;PK_U32 packetizationRate; <keep default 2>PK_BOOL vadEnabled;
} TVOIPEncodeParameters;
![Page 16: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/16.jpg)
VoIP API – Encode – codecType• PK_VOIP_EncodeSetParameters( )
Codec Types
typedef enum{PK_PCMU = 0,PK_PCMA = 1,PK_G726_16 = 4,PK_G726_24 = 5,PK_G726_32 = 6,PK_G726_40 = 7
} TCodecType;
![Page 17: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/17.jpg)
VoIP API – Encode – payloadType• PK_VOIP_EncodeSetParameters( )
Payload Type
Codec Payload TypeG.711 µ-law 0G.711 A-law 8G.726 2 / dynamic
For details see: www.ietf.org/rfc/rfc3551.txt
![Page 18: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/18.jpg)
VoIP API – Encode – GetBufferSize• PK_VOIP_EncodeGetBufferSize
(TResourceHandle hPort);
• Must be called after SetParameters but before AddBuffer• Returns the recommended size of the buffer (in bytes)• e.g. if G.711, packetization 2: required RTP buffer size
returned is 172 bytes (12 bytes RTP header + 2 x 80 bytes payload)
• Used to allocate memory for the buffer (.lpData)• Used to set the length of the buffer (.dwBufferLength)
[See Page 202 of Programmer’s Guide]
![Page 19: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/19.jpg)
VoIP API – Encode – AddBuffer• PK_VOIP_EncodeAddBuffer (TResourceHandle hPort, TBufferHeader
*pBuffer);
• Called after EncodeGetBufferSize but before EncodeStart
• The buffer passed-in must at least be as large as the buffer size returned by PK_VOIP_EncodeGetBufferSize
• The buffer is returned to the application once it is filled (by RTP encoding, hport).
![Page 20: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/20.jpg)
VoIP API – Encode – Start• PK_VOIP_EncodeStart (TResourceHandle hPort);
• Called after EncodeAddBuffer• Starts RTP encoding process on DSP port, hPort• Encoded RTP packets are returned to
application via installed ‘event handler’ (of hport) and indicated by event PK_EVENT_VOIP_ENCODE_RETURN_PACKET
• The packet is now ready for transmission over the host network interface
![Page 21: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/21.jpg)
VoIP API – Encode – Stop• PK_VOIP_EncodeStop (TResourceHandle
hPort);
• Called after Encodestop• Stops an RTP encoding operation on the DSP
port specified by hPort• Used when the VoIP call terminates
![Page 22: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/22.jpg)
Related API – called before VoIP API
• PK_DSP_GetDeviceHandle
• PK_DSP_DEVICE_SeizePort
• PK_DSP_PORT_SetEventHandle• PK_CTBUS_FullDuplexConnect //Line Port
DSP Port
![Page 23: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/23.jpg)
Related API – SeizePort (DSP)
• PK_DSP_DEVICE_SeizePort (TDeviceHandle hDsp, TResourceMask resMask );
Example:
resMask = PK_RTP|PK_G711|PK_ECHO_CANCELLATION
![Page 24: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/24.jpg)
VoIP API• PK_VOIP_EncodeSetParameters• PK_VOIP_EncodeGetBufferSize• PK_VOIP_EncodeAddBuffers• PK_VOIP_EncodeStart• PK_VOIP_EncodeStop
• PK_VOIP_DecodeSetParameters• PK_VOIP_DecodeGetBufferSize• PK_VOIP_DecodeStart• PK_VOIP_DecodeAddBuffers• PK_VOIP_DecodeStop
![Page 25: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/25.jpg)
VoIP API – Decode – SetParameters• PK_VOIP_DecodeSetParameters (TResourceHandle hPort, TVOIPDecodeParameters *decodeParams);
typedef struct{TCodecType codecType;PK_U32 payloadType;PK_U32 initialLatencyInFrames; //default 3PK_BOOL dynamicJitterBufferEnabled; //TRUE or
FALSEPK_U32 jitterBufferPeriod; //default 640msPK_U32 fixedLatencyInFrames; //1-11
} TVOIPDecodeParameters;
![Page 26: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/26.jpg)
VoIP API – Decode – initialLatencyInFrames
• PK_VOIP_DecodeSetParameters( )
initialLatencyInFrames:• Indicates number of frames that will be placed
in the jitter buffer before starting the RTP decoder
• Suggested/default value is 3 • 0 or 1 will have the RTP receiver start the
decoder as soon as an RTP packet is received
![Page 27: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/27.jpg)
VoIP API – Decode – dynamicJitterBufferEnabled
• PK_VOIP_DecodeSetParameters( )
dynamicJitterBufferEnabled:• Set as PK_TRUE or PK_FALSE• RTP process will manage the number of frames to
put in the jitter buffer by analyzing the packets received
• After the jitterBufferPeriod is expired, the number of “initial frames” in the jitter buffer may change based on timing of the packets received
![Page 28: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/28.jpg)
VoIP API – Decode – jitterBufferPeriod
• PK_VOIP_DecodeSetParameters( )
jitterBufferPeriod:• Defines how often the RTP receiver manages
the jitter buffer in number of 10 milliseconds• Default value is 640 ms
![Page 29: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/29.jpg)
VoIP API – Decode – fixedLatencyInFrames
• PK_VOIP_DecodeSetParameters( )
fixedLatencyInFrames:• Identifies the fixed number of frames to be
stored in the jitter buffer• 1 is the minimum, 11 is the maximum value
for this parameter• Applied when dynamicJitterBufferEnabled is
set to PK_FALSE
![Page 30: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/30.jpg)
VoIP API – Decode – SetParameters - ExampleTVOIPDecodeParameters VOIPDecodeParameters ;
VOIPDecodeParameters.codecType = PK_PCMU;VOIPDecodeParameters.payloadType = 0;VOIPDecodeParameters.initialLatencyInFrames =
PK_VOIP_INITIAL_LATENCY_DEFAULT; // 3 (frames)
VOIPDecodeParameters.dynamicJitterBufferEnabled = PK_TRUE;VOIPDecodeParameters.jitterBufferPeriod =
PK_VOIP_JITTER_BUFFER_PERIOD_DEFAULT; // 64 (640ms)VOIPDecodeParameters.fixedLatencyInFrames = 0;
PK_VOIP_DecodeSetParameters ( hDSPPort, &VOIPDecodeParameters );
![Page 31: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/31.jpg)
VoIP API – Decode – GetBufferSize
• PK_VOIP_DecodeGetBufferSize( )
• Provided for consistency with Encode• Returned value is calculated based on the size of
RTP header and the maximum allowed payload (200 ms)
• Application may allocate smaller buffers if the worst case is known for the expected number of frames per RTP packet
![Page 32: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/32.jpg)
Important notes:• DSP port seized for VoIP streaming can perform
both encode and decode simultaneously; i.e. one DSP port per VoIP session
• For encode: add ~15 buffers before calling PK_VOIP_EncodeStart
• For decode: use of only one buffer is sufficient; to be added after calling PK_VOIP_DecodeStart (once filled with an incoming packet)
![Page 33: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/33.jpg)
Related API – Echo Cancellation
• PK_DSP_DEVICE_SeizePort (hDSPDevice , PK_ECHO_REFERENCE);
• PK_CTBUS_HalfDuplexConnect (hDSPPort , hDSPPortER);
• PK_EC_Initialize (hDSPPort , hDSPPortER , 12); //last parm Tail Length
• PK_EC_Enable (hDSPPort);
![Page 34: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/34.jpg)
Integration with VoIP signaling stacks
• No restriction on use of any stack due to low-level, modular and flexible VoIP API
• Sample integration with SIP is available• Customers have done integration with
H.323, MS SIP, oSIP, Vovida• MonteCarlo 6.3 to provide an embedded
SIP stack as well
![Page 35: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/35.jpg)
PIKA board support and other hardware requirements
• All PIKA board types support VoIP• PrimeNet MM (E1/T1), Daytona MM (LS/POTS),
InLine MM (LS)
• DSP-based, common to all boards• Host NIC used for IP connection
![Page 36: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/36.jpg)
Setting up DSPs for VoIP using PikaSetup.exe
![Page 37: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/37.jpg)
![Page 38: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/38.jpg)
![Page 39: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/39.jpg)
VoIP Test and Sample Applications
![Page 40: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/40.jpg)
Test application
• PikaTest.exe• Part of MonteCarlo 6.2 installation, under PIKA Bin
folder• General multi-purpose application• Command-line based
![Page 41: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/41.jpg)
Test/sample applications
• VoIP_Sample_DMM• Demonstrates use of VoIP API in a focused manner• No signaling stack integration• Easy setup, requires one DMM POTS only• VoIP audio streaming between two phones on DMM• Echo cancellation enabled• Available online under Downloads Sample Code
![Page 42: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/42.jpg)
Test/sample applications• SIP Demo v0.5
• Much larger application, includes SIP integration• Able to register the system (i.e., a VoIP client) with a publicly
available or private SIP proxy• Full ‘call’ support; including invite, trying and bye messages• Can place VoIP calls between two PIKA-based systems (VoIP
clients) or to a SIP phone• Verified under numerous SIP proxies• Online under Downloads Sample Code
![Page 43: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/43.jpg)
SIP demo configuration
Telephony Switch
SIP Proxy
SIP Server 1
NIC
Daytona
SIP Stack + MC 6.2SIP Server 2
NIC
Daytona
SIP Stack + MC 6.2
Any phone
GrandStream VoIP phone
ext. 441 ext. 442
ext. 450
External line(591-0000)
PIKA WORLD
PSTN WORLD
![Page 44: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/44.jpg)
Thank You• If you are interested in taking a closer look,
download our Programmer’s Guide:• http://www.pikatechnologies.com/downloads/software.htm
• Additional HW info is available from:• http://www.pikatechnologies.com/downloads/hardware.htm
• If you want to speak to the sales account manager in your region, a field application engineer, or technical support, the next slide has their contact information…
![Page 45: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/45.jpg)
How to reach our people• Sales
• Western USA – Brett Sumpter phone: +1-903-939-3711
• Eastern USA – Cheryl Farmer phone: +1-770-345-5944
• EMEA – Maarten Kronenburg phone: +31 76 5083 560
• Canada, Americas & Asia – Terry Atwood phone: +1-613-591-1555 x329
• Field Application Engineers• Yashar Moghan – phone: +1-613-591-1555 x415• Cindy Xu – phone: +1-613-591-1555 x458
• Technical Support • [email protected]• Phone: +1-613-591-1555 x216
![Page 46: Run the slides](https://reader036.vdocuments.mx/reader036/viewer/2022062513/555bdadbd8b42a33078b45ba/html5/thumbnails/46.jpg)
Thank youfor your time.