Dialogic Dialogic Global Call IP IP Phone User Manual


 
Dialogic
®
Global Call IP Technology Guide — November 2007 109
Dialogic Corporation
IP-Specific Operations
For details on the overall configuration process, including the default values and the allowable
values that can be set for each configuration item, see Section 8.3.27, “gc_Start( ) Variances for
IP”, on page 491, the reference page for IP_VIRTBOARD on page 553, and the reference page for
IPCCLIB_START_DATA on page 558. In addition to this overall information, details on how to
configure specific capabilities and features (including code snippets showing specific
configurations) are provided in the sections of this chapter that document those features, including
the following subsections which describe the configuration of the SIP outbound proxy and the SIP
transport protocol.
Note: Features that are enabled or configured via the IPCCLIB_START_DATA and IP_VIRTBOARD
structures cannot be disabled or reconfigured once the library has been started. All items set in
these data structures take effect when the gc_Start( ) function is called and remain in effect until
gc_Stop( ) is called when the application exits.
4.1.1 Setting a SIP Outbound Proxy
When initializing a board device for use with SIP, the application can set an outbound proxy. When
such a proxy is set, all outbound requests are sent to the proxy address rather than the IP address of
the original Request-URI. The proxy can be set by specifying an IP address or a host name in the
IP_VIRTBOARD structure that is used in the gc_Start( ) function. If both an IP address and a host
name are specified in IP_VIRTBOARD, the IP address takes precedence.
The following code snippet illustrates how to set a SIP outbound proxy for a single board:
#include "gclib.h"
..
..
#define BOARDS_NUM 1
..
..
/* initialize start parameters */
IPCCLIB_START_DATA cclibStartData;
memset(&cclibStartData,0,sizeof(IPCCLIB_START_DATA));
IP_VIRTBOARD virtBoards[BOARDS_NUM];
memset(virtBoards,0,sizeof(IP_VIRTBOARD)*BOARDS_NUM);
/* initialize start data */
INIT_IPCCLIB_START_DATA(&cclibStartData, BOARDS_NUM, virtBoards);
/* initialize virtual board */
INIT_IP_VIRTBOARD(&virtBoards[0]);
// set outbound proxy by IP Address
virtBoards[0].outbound_proxy_IP.ip_ver = IPVER4;
virtBoards[0].outbound_proxy_IP.u_ipaddr.ipv4 = inet_addr("192.168.1.227");
// set outbound proxy by hostname.
// if outbound proxy is also set by IP address, this is ignored
char OutboundProxyHostName[256];
strcpy(OutboundProxyHostName,"my_outbound_proxy");
virtBoard[0].outbound_proxy_hostname = OutboundProxyHostName;
// set outbound proxy port
virtBoards[0].outbound_proxy_port = 5060;