Dialogic Dialogic Global Call IP IP Phone User Manual


 
166 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
IP-Specific Operations
No other parameter elements can be present in the GC_PARM_BLK when canceling a re-INVITE
request.
4.7.7 Updating Dialog Properties via re-INVITE
Dialog properties that are specified in SIP message header fields can be updated or changed by
sending a re-INVITE request that contains header fields with new values. The most common use of
this capability is to provide updated Contact information or to refresh it when the Expires interval
is exceeded. Note that either party in a dialog can issue a re-INVITE to refresh or update dialog
properties.
As noted earlier in this section, applications cannot change the Call-ID, the URI or Tag in the From
and To headers, or the CSeq, since all of these are restricted values in re-INVITE requests.
With the exception of three header fields that the library automatically populates, only the header
fields that are explicitly specified by the application will be transmitted in the re-INVITE and
updated at the remote endpoint. The Contact and Via headers are automatically populated by the
library with the corresponding header values from the last 2xx or INVITE message that was sent by
the application in the current dialog unless the application explicitly sets the header in the re-
INVITE. The other auto-fill header field is Max-Forwards, which is set to 70 by default.
When the application only needs to send updated header fields (that is, when does not also need to
change any media session properties), the simplest approach is for the application to not include
any capability elements in the GC_PARM_BLK that it passes to gc_ReqModifyCall( ). In this
circumstance, the library automatically inserts the last SDP answer in the re-INVITE request that it
constructs. Alternatively, the application can explicitly insert the current capabilities in the
GC_PARM_BLK.
The following code example illustrates the use of re-INVITE to update the Contact header:
.
.
.
#include <gcip.h>
#include <gclib.h>
.
.
.
/* Request Contact refresh: */
/* Assumes: 1) caller has verified call to be in connected state */
/* 2) caller has enabled event handler for GCEV_MODIFY_CALL_ACK, */
/* GCEV_MODIFY_CALL_REJ, and GCEV_MODIFY_CALL_FAIL. */
int refreshToHomeLocation (CRN crn)
{
char *pContactHeader = "Contact: Rich <r.intelligent@myhomeISP.com>";
gc_util_insert_parm_ref_ex(&parmblkp,
IPSET_SIP_MSGINFO,
IPPARM_SIP_HDR,
(unsigned long)(strlen(pContactIdHeader) + 1),
pContactHeader);
if (NULL == parmblkp) return FAILURE;