GetPort(string) function

Microsoft Office Live Communications Server 2005 with SP1


The GetPort function returns the port specified in a SIP URI.



  • uri
    A string containing the URI whose port will be parsed and returned. The function accepts only a valid SIP URI string in the following form: where "Display Name" <sip:user@host:port;param=value> For example, GetPort("") returns the port string value "6767".

Return Values

Returns the port number. Returns 0 if the requested data is not found or if the URI passed in is not a valid SIP URI in the form specified above. Live Communications Server 2003 applications that pass non-SIP URI strings to this function need to be modified to work properly with Live Communications Server 2005 with SP1.


The port value occurs in a SIP URI after the hostname and separated by a colon. For example, a URI with a specified port appears as "" with the port being 6767.

What did you think of this topic?
© 2008 Microsoft Corporation. All rights reserved.