JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
SIPAPI Developer's Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  SIP Overview

2.  Oracle Solaris SIP Internals

SIP Stack Initialization

Generic Stack Parameters

Upper Layer Registrations

Connection Manager Interfaces

Custom Header Table

Header Management Layer

Writing Parsers For Custom Headers

Transaction Management Layer

Transaction Creation And Maintenance

Transaction Creation and ACK Signal Generation

Transaction Deletion

Transaction Lookup

Transaction Timers

Transaction And Network Errors

Dialog Management Layer

UAC Dialog Creation

UAS Dialog Creation

Dialog Caching

Dialog Termination, Deletion, and Notification

Message Formatting Layer

Receiving Messages

Sending Messages

Connection Manager

Connection Object

Caching a Connection Object

Freeing a Connection Object

Sending Messages

Receiving Messages

Transaction Layer and I/O Errors

Timer Management Layer

Generating Call-ID, From and To tags, Branch-ID and Cseq

Multithreading Support

3.  Multithreading and URI Support

4.  SIP API Functions

A.  Examples of Use

B.  Programming with the SIP API

C.  Transaction Timers

Index

Generating Call-ID, From and To tags, Branch-ID and Cseq

The library provides the sip_guid() function to generate unique identifiers for the Call-ID, From, and To tags. The stack generates the identifier by combining the upper 32 bits that are returned by the gethrtime() function with a 32–bit random number from the /dev/urandom pseudo-device. The stack randomly replaces numbers in the result with alphabetic characters. The applicatioon is responsible for freeing the string that is returned by the sip_guid() function.

The library provides the sip_branchid() function to generate Branch-ID fields. If the application invokes the sip_branchid() function without a SIP message, or if the SIP message does not have a VIA header, the stack forms a Branch-ID field by using the sip_guid() function. If the SIP message already has a VIA header, the stack generates the Branch-ID by using the MD5 hash of the following fields:

All branch identifiers begin with the string z9hG4bK. This behavior complies with RFC 3261. The application is responsible for freeing the string that is returned by the sip_branchid() function.

An application can use the sip_get_cseq() or sip_get_rseq() functions to obtain the initial sequence number. The sip_get_cseq() and sip_get_rseq() functions use the 31 most significant bits of the value that is returned by the time(2) function call.