Answered by:
OCS 2007 extended application. [How to send the message to Client from server ]

Question
-
I am currently able to log the communication with the help of arhiver sample in the SAmple of SDK.
Now suppose There are two Client A and B.
Client A have send some message to Clinet B.I am able to catch it. [I can also cancel it to deliver to B]
What I want's is to send a message [let say custom error message saying your message limits over] to A without notifying B.
My current code is like
Code Snippetpublic void OnRequest(object sender, RequestReceivedEventArgs e)
{
e.Request.SimpleProxy = true;
e.ServerTransaction.EnableForking = false;
e.ServerTransaction.CreateBranch().SendRequest(e.Request);
if (e.Request.Stamp != "Archived")
{
lock (LogFile)
{
LogFile.WriteLine("-----------------------------------------------------------");
LogFile.WriteLine(" Request: {0} {1}", e.Request.Method, e.Request.RequestUri);
foreach (Header h in e.Request.AllHeaders)
{
LogFile.WriteLine(" {0}: {1}", h.Type, h.Value);
}
LogFile.WriteLine();
LogFile.WriteLine(e.Request.Content);
LogFile.Flush();
}
e.Request.Stamp = "Archived";
}
e.Request.SetDestination(null);
}
public void OnResponse(object sender, ResponseReceivedEventArgs e)
{
e.ClientTransaction.ServerTransaction.SendResponse(e.Response);
if (e.Response.Stamp != "Archived")
{
lock (LogFile)
{
LogFile.WriteLine("-----------------------------------------------------------");
LogFile.WriteLine(" Response: {0} {1}", e.Response.StatusCode, e.Response.ReasonPhrase);
foreach (Header h in e.Response.AllHeaders)
{
LogFile.WriteLine(" {0}: {1}", h.Type, h.Value);
}
LogFile.WriteLine();
LogFile.WriteLine(e.Response.Content);
LogFile.Flush();
}
}
and .am file is as below<?xml version="1.0"?>
<r:applicationManifest
r:appUri="http://Test.com/myAppName7"
xmlns:r="http://schemas.microsoft.com/lcs/2006/05">
<!--
- Handle all IMs, including those with strict routes
- and those with request URIs that don't match this server's
- domain.
-->
<r:requestFilter methodNames="ALL" strictRoute="true" domainSupported="false" />
<!--<r:requestFilter methodNames="MESSAGE,INVITE,ACK,BYE" strictRoute="true" domainSupported="false" />-->
<!--
- Handle all responses.
-->
<r:responseFilter reasonCodes="ALL"/>
<r:splScript>
<![CDATA[
if (sipRequest)
{
Dispatch("OnRequest");
}
else
{
Dispatch("OnResponse");
}
]]>
</r:splScript>
</r:applicationManifest>Wednesday, November 12, 2008 8:51 AM
Answers
-
Any luck figuring this out? I am interested to know if you have...Tried using resonse(http error code, custom message) route, but the problem is OC client ignores custom error messages=( Instead it displays the error code (ex 504) and sticks a generic link to a MS page that says "unknown erro".
- Marked as answer by Kamran Shahid Friday, June 19, 2009 11:07 AM
Thursday, April 9, 2009 9:31 PM
All replies
-
Any help my friends in it?
Kamran Shahid (MCP,MCAD,MCSD.NET,MCTS,MCPD.net[web])Monday, January 19, 2009 10:08 AM -
Any luck figuring this out? I am interested to know if you have...Tried using resonse(http error code, custom message) route, but the problem is OC client ignores custom error messages=( Instead it displays the error code (ex 504) and sticks a generic link to a MS page that says "unknown erro".
- Marked as answer by Kamran Shahid Friday, June 19, 2009 11:07 AM
Thursday, April 9, 2009 9:31 PM -
Yes npopv you are excatly right that even if we change the message ocs client ignores it.
http://social.microsoft.com/Forums/en-US/ucmanagedsdk/thread/c45f79b8-1f6d-4034-9097-ca4a49c9eb7a
What we come up with idea is that open a new IM window in which we send a Text Massage.
Check http://social.microsoft.com/Forums/en-US/ucmanagedsdk/thread/c0b8ad81-d448-4608-b074-8cf7c948b945
It might help you
Kamran Shahid (MCP,MCAD,MCSD.NET,MCTS,MCPD.net[web])Friday, April 10, 2009 7:04 AM