HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

REFER 279
Implementing REFER-related Application Callbacks
Example 3
The “Refer-To:<sip:C@xxx.com;method=REFER?Refer-
To=C%3Csip:c%40yyy.com%3E>
” header identifies that the referee should
contact the refer target with a REFER request which will include the “
Refer-
To:C<sip:c@yyy.com>
” header.
Example 4
The “Refer-To:<sip:C@xxx.com;method=OPTIONS?apple=red>” header
identifies that the referee should contact the REFER target with an OPTIONS
request which will include the “
apple:red” header.
The SIP Stack supports all methods given in the Refer-To header. The
RvSipSubsReferAccept() function creates a new object that will be used to
contact the REFER target. The type of the new allocated object is determined
according to the following method parameters:
INVITE method (or no method at all) will create a new call-leg.
SUBSCRIBE and REFER methods will create a new
subscription.
All other methods will create a new transaction.
The SIP Stack automatically initializes the new object with the necessary
information, such as the To and From headers, and the header list taken from the
Refer-To header. Applications that wish to support only specific methods should
check the method parameter before accepting the REFER request. The
application can also force the SIP Stack to create a specific object regardless of
the method parameter. (For example, create a new transaction, and not a call-leg
or subscription for the INVITE, REFER and SUBSCRIBE methods). For more
details, see the RvSipSubsReferAccept() function in the SIP Stack Reference
Guide.
Note When the newly created object is a transaction, the
RvSipSubsReferNotifyReadyEv() callback will not be called, and the application
is responsible for sending the NOTIFY request once the transaction has reached
a final status.
IMPLEMENTING
REFER-
RELATED
A
PPLICATION
C
ALLBACKS
The following sample codes demonstrate the implementation of two callbacks
that are part of the REFER process.