public void Call(SIPCallDescriptor descriptor)
{
try
{
CallDescriptor = descriptor;
SIPURI destinationURI = SIPURI.ParseSIPURIRelaxed(descriptor.Uri);
bool wasSDPMangled = false;
IPEndPoint sdpEndPoint = null;
if (descriptor.MangleIPAddress != null)
{
sdpEndPoint = SDP.GetSDPRTPEndPoint(descriptor.Content);
if (sdpEndPoint != null)
{
descriptor.Content = SIPPacketMangler.MangleSDP(descriptor.Content, descriptor.MangleIPAddress.ToString(), out wasSDPMangled);
}
}
if (wasSDPMangled)
{
Log_External(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "SDP on Google Voice call had RTP socket mangled from " + sdpEndPoint.ToString() + " to " + descriptor.MangleIPAddress.ToString() + ":" + sdpEndPoint.Port + ".", Owner));
}
else if (sdpEndPoint != null)
{
Log_External(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "SDP on Google Voice call could not be mangled, using original RTP socket of " + sdpEndPoint.ToString() + ".", Owner));
}
SIPDialogue = m_googleVoiceCall.InitiateCall(descriptor.Username, descriptor.Password, descriptor.CallbackNumber, destinationURI.User, descriptor.CallbackPattern, descriptor.CallbackPhoneType, MAX_CALLBACK_WAIT_TIME, descriptor.ContentType, descriptor.Content);
if (SIPDialogue != null)
{
CallAnswered(this, null);
}
else
{
CallFailed(this, "Google Voice call failed.");
}
}
catch (Exception excp)
{
logger.Error("Exception GoogleVoiceCallAgent Call. " + excp.Message);
CallFailed(this, excp.Message);
}
}