Copyright 2010-2017 Obihai Technology, Inc.
63
Some server implementations will include the outbound proxy server in a Record-Route header such that the phone
should not respect the locally configured
OutboundProxy
value after the initial INVITE is sent for a new call. This
behavior can be achieved by enabling the option
ITSP Profile X
–
SIP
::
X_BypassOutboundProxyInCall
. This option
however has no effect when the
OutboundProxyTransport
is TCP/TLS as the phone will always use the same
connection to send messages to the server.
DNS Lookup of SIP Servers
When sending out SIP requests to the server the device looks up the IP address of the server, using DNS query if the
server is specified as a domain name instead of an IP address. If an Outbound Proxy Server is configured, it is used
instead of the SIP Proxy Server or SIP Registration Server. The resolution of the server domain name into IP address is
performed in the following manner:
•
If
ITSP Profile X
–
SIP
::
X_DnsSrvAutoPrefix
is enabled, resolve the name as DNS A Record, DNS SRV Record
and as DNS SRV record with a service prefix prepended to the name in parallel by sending 3 queries to each DNS server
at the same time. The service prefix to prepend to the name depends on the transport protocol being used; for SIP,
_sip._udp.
for UDP,
_sip._tcp.
for TCP and
_sip._tls.
for TLS. If more than one valid result is returned
from the queries, the DNS SRV result for the name with prefix has the highest priority, then the DNS SRV result for the
name without the prefix, then the DNS A result
•
Otherwise, resolve the name as a DNS A record and as a DNS SRV Record in parallel by sending 2 queries to
each DNS server. If both queries return a valid result, the DNS SRV result will be taken over the DNS A result
•
If no valid results are returned, the phone considers the SIP request failed with the error code 901
If the result from the DNS query is a SRV record, the server port is also taken from that record (the server port value
configured on the device is ignored). Otherwise, the server port is taken from the configured value or 5060 will be used
if no value is specified. We recommend setting the
ProxyServerPort
to 0 (i.e. the unspecified value) if DNS SRV
lookup is intended for the service.
NAT Traversal Considerations
If the phone is located behind NAT with respect to the service provider equipment, it can discover the mapped external
address corresponding to its local SIP contact address as seen by the server. This may help in some cases where a
gateway router’s SIP ALG implementation is causing communication problems between the device and the server. The
device can discover the mapped external address in one of the following ways:
•
From the “received=” and “rport=” parameters of the VIA h
eader of the REGISTER response sent by the server;
these two parameters tell the device its mapped IP address and port number respectively. This method is used if
periodic registration is enabled on the device
•
From the response to a STUN binding request the device sent to a STUN server. This method is used by
enabling
X_KeepAliveEnable
and setting the
X_KeepAliveMsgType
parameter to “stun”. In this case, the STUN
server is taken from the
X_KeepAliveServer
parameter, if it is specified. Otherwise, the keep-alive messages are
sent to the same server where a REGISTER request would be sent to. The latter is the most effective way of using STUN
to discover the mapped external contact address
•
From the value of the
ITSP Profile X
–
SIP
::
X_PublicIPAddress
parameter.
The discovered external IP address and port, if discovered by one of the methods above, will be used by the phone to
replace its private address and port when generating SIP requests, if the
ITSP Profile X
–
SIP
::
X_DiscoverPublicAddress
option is also enabled. The substitution of private addresses with public addresses
applies to the Contact header of any SIP requests and the
c=
line in SDP. If the option
X_UsePublicIPAddressInVia
is also enabled, the Via address is also substituted (however this is usually not necessary).
The phone can also include an empty rport parameter in the Via header of outbound SIP requests if the option
ITSP
Profile X
–
SIP
::
X_UseRport
option is enabled. This parameter is sometimes needed to prompt the server to insert an