Hello,
VS 2008
I am using the code below to detect if the client can connect to our sip server. This was working fine. However, the client has changed there network and now my application has to connect to the sip server from behind a proxy server.
The error I get is the "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xxx.xxx.xx.xx:xx"
This code was working ok, until I have to connect from behind a poxy server.
I could not see any properties there I can add the proxy address to the socket.
Am I missing something?
Many thanks for any suggestions,
public bool IsSIPServerAvailable()
{
bool isAvailable = true;
Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
try
{
sock.Connect("xxx.xxx.xx.xx", xx);
}
catch (SocketException ex)
{
Console.WriteLine(ex.Message);
isAvailable = false;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
isAvailable = false;
}
finally
{
if (sock.Connected)
{
sock.Close();
}
}
return isAvailable;
}