本文整理汇总了C#中Proxy.CreateResponse方法的典型用法代码示例。如果您正苦于以下问题:C# Proxy.CreateResponse方法的具体用法?C# Proxy.CreateResponse怎么用?C# Proxy.CreateResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Proxy
的用法示例。
在下文中一共展示了Proxy.CreateResponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RouteNewResponse
private static void RouteNewResponse(Message response, Proxy pua)
{
Message proxiedResponse = pua.CreateResponse(response.ResponseCode, response.ResponseText);
pua.SendResponse(proxiedResponse);
}
示例2: ContinueRoutingMessage
private static void ContinueRoutingMessage(Message request, Proxy pua, Block block)
{
SIPURI to = request.Uri;
string toID = to.User + "@" + to.Host;
Address from = (Address)(request.First("From").Value);
string fromID = from.Uri.User + "@" + from.Uri.Host;
Address dest = new Address(to.ToString());
Address temp_dest = CheckServiceBlock(request, block, toID, fromID);
if (temp_dest != null)
{
dest = temp_dest;
}
if (dest.ToString().Contains("anonymous.invalid"))
{
Message proxiedMessage = pua.CreateResponse(403, "Forbidden");
pua.SendResponse(proxiedMessage);
}
else
{
Message proxiedMessage = pua.CreateRequest(request.Method, dest, true, true);
proxiedMessage.First("To").Value = dest;
pua.SendRequest(proxiedMessage);
}
}