Dialogic Dialogic Global Call IP IP Phone User Manual


 
422 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
gc_SetAuthenticationInfo( ) — set IP authentication information
a quadruplet that already exists, the existing username and password are overwritten with the new
strings. If the identity field in the IP_AUTHENTICATION structure is an empty string, the
function will set the specified username and password as the defaults for the specified realm.
To remove an authentication quadruplet to the Global Call database, the application inserts a
parameter element of the following type into the infoparmblkp parameter block:
IPSET_CONFIG
IPPARM_AUTHENTICATION_REMOVE
value = IP_AUTHENTICATION data structure identifying the realm and identity of the
quadruplet to remove
In this case, the library will remove the existing authentication quadruplet that matches the realm
and identity strings that are specified in the IP_AUTHENTICATION structure; the username and
password elements in the IP_AUTHENTICATION structure are ignored.
Cautions
The gc_SetAuthenticationInfo( ) function can only be called on a virtual board device.
If the GC_PARM_BLK contains multiple parameter elements with the same realm/identity
pair in their IP_AUTHENTICATION structures, all of those parameters are ignored except for
the one that is last in the GC_PARM_BLK.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the
reason for the error. See the “Error Handling” section in the Dialogic
®
Global Call API
Programming Guide. All Global Call error codes are defined in the gcerr.h file.
Possible errors include:
IPERR_BAD_PARM
returned if any of the string pointers in an IP_AUTHENTICATION structure is NULL or if
there is any other invalid parameter
IPERR_UNAVAILABLE
returned when the realm/identity does not exist in the Global Call database when the
application attempts to remove the quadruplet
IPERR_UNSUPPORTED
returned when the function is called on a line device or CRN rather than a virtual board
Examples
The following code example illustrates how to add or modify a digest authentication quadruplet.
#include <gcip.h>
#include <gclib.h>
/* This example adds or modifies the quadruplet with realm "example.com" and
* identity "sip:bob@example.com". If this realm/identity do not exist on this
* virtual board, this quadruplet will be added. If this realm/identity exist
* already, it will be override by this quadruplet.
*/