HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
44 HP-UX C SIP Stack Programmer’s Guide
Call-leg API
CALL-LEG API The Call-leg API contains a set of functions and function callbacks that allow
you to set or examine call-leg parameters and control call-leg behavior.
CALL-LEG
P
ARAMETERS
You can set or examine call-leg parameters via Call-leg Set and Get API
functions. The following parameters are available:
To Header, From Header, Call-ID, and CSeq
When creating an outgoing call, you must set the To and From headers of the
call-leg. A call-leg is uniquely identified by its To and From tags and its Call-
ID. You do not have to set the tags or the Call-ID yourself. The SIP Stack will
generate random tags and the Call-ID for you. The call-leg automatically
handles the CSeq, and increases it by one for each outgoing request.
Remote Contact Address
The address for contacting the remote party. For outgoing calls, the remote
contact is used as the Request-URI. If you do not set the remote contact, the To
address is taken. For incoming calls, the remote contact address is the contact
address taken from the received INVITE message. You should set the remote
contact only once, for outgoing calls only, and only when the call is in the IDLE
state. The SIP Stack automatically updates the remote contact when a refresh
request or a 2xx response to a refresh request is received.
The remote contact is also used to specify the transport of an initial request. To
send an initial request using TCP, you must set the remote contact transport to
TCP.
Local Contact Address
The address that the caller sends to the remote party as a contact address in the
Contact header. If you do not set a contact address, the From address is taken.
The SIP Stack inserts the contact into every outgoing request, except for BYE
and CANCEL. The contact is also added to response messages of different
requests, each according to its RFC rules. For incoming calls, the local contact
address is taken from the INVITE message Request-URI field, but you can
change it using a Set function.
Outbound Address and Local Address
The addresses the call-leg uses for sending requests. If you set the call-leg
outbound address, all requests with no Route headers will be sent to this address
regardless of the message Request-URI. The local address defines the address
from which the Request will be sent (the network card). This is also the address