views:

35

answers:

0

I have an Office Communication Server 2007 R2 installed, and with a static rule to reroute all the messages with a specific domain to my UCMA application.

What I am trying to do is to receive the SUBSCRIBE messages in my UCMA application and handle them. However, the messages are rejected by the API with 500 Internal Server Error before I would have a chance to be notified through an event handler about an incomming session or incomming SIP message.

I put the relevant code skeleton below. Can somebody tell me why I have the message rejection?

// Preparing the connection manager
serverTlsConnectionManager = new RealTimeServerTlsConnectionManager( 
                    machineCert.IssuerName.Name, machineCert.GetSerialNumber());
serverTlsConnectionManager.NeedMutualTls = true;
serverTlsConnectionManager.StartListening(new IPEndPoint(localIpAddress, 5061));

// Preparing sip endpoint
endpoint = new SipEndpoint(
                "sip:myappcontact@mydomain", 
                SipAuthenticationProtocols.None, 
                SipTransportType.Tls, 
                "OCSServer",
                5061,
                true,
                serverTlsConnectionManager,
                null);
endpoint.SessionReceived += OnSessionReceived;
endpoint.MessageReceived += OnMessageReceived;


// Preparing the registration of the endpoint
List<SignalingHeader> list = new List<SignalingHeader>();                
list.Add(SignalingHeader.MicrosoftSupportedEventCategories);
list.Add(SignalingHeader.MicrosoftSupportedForking);
list.Add(SignalingHeader.MicrosoftSupportedPresence);

// SUBSCRIBE method is also included!
endpoint.RegisterMethods = "Service,Notify,Benotify,Message,Info,Options,Subscribe";
Console.WriteLine("Registering for methods: " + endpoint.RegisterMethods);
endpoint.BeginRegister(list, RegisterComplete,endpoint);

// Registration successful

The request received by the application looks like this (taken from snooper):

TL_INFO(TF_PROTOCOL) [0]0A80.0FCC::10/08/2010-16:13:27.748.0000045c (S4,SipMessage.DataLoggingHelper:118.idx(581))
<<<<<<<<<<<<Incoming SipMessage c=[<SipTlsConnection_17E4516>], 10.124.0.121:5061<-10.124.0.120:61769
SUBSCRIBE sip:me@home SIP/2.0
FROM: "OCS ONE"<sip:[email protected]>;tag=4b3f58d59f;epid=b566c6d8b3
TO: <sip:me@home>
CSEQ: 1 SUBSCRIBE
CALL-ID: fa199d310f0a4452a6ab8214dacdd406
MAX-FORWARDS: 69
VIA: SIP/2.0/TLS 10.124.0.120:61769;branch=z9hG4bKE1398849.89445100022DE327;branched=FALSE
VIA: SIP/2.0/TLS 10.123.2.191:52650;ms-received-port=52650;ms-received-cid=BE00
ACCEPT: application/msrtc-event-categories+xml, application/xpidf+xml, text/xml+msrtc.pidf, application/pidf+xml, application/rlmi+xml, multipart/related
CONTACT: <sip:[email protected];opaque=user:epid:A2IuBdIOolG916cccjgPXgAA;gruu>
CONTENT-LENGTH: 448
EVENT: presence
SUPPORTED: com.microsoft.autoextend
SUPPORTED: ms-piggyback-first-notify
USER-AGENT: UCCAPI/3.5.6907.206 OC/3.5.6907.206 (Microsoft Office Communicator 2007 R2)
CONTENT-TYPE: application/msrtc-adrl-categorylist+xml
ms-user-data: ms-publiccloud=false;ms-federation=false
<batchSub xmlns="http://schemas.microsoft.com/2006/01/sip/batch-subscribe" uri="sip:[email protected]" name=""><action name="subscribe" id="3568824"><adhocList><resource uri="sip:me@home"/></adhocList><categoryList xmlns="http://schemas.microsoft.com/2006/09/sip/categorylist"&gt;&lt;category name="state"/><category name="note"/><category name="contactCard"/><category name="services"/><category name="calendarData"/></categoryList></action></batchSub>------------EndOfIncoming SipMessage

The response sent back to OCS from the application:

TL_INFO(TF_PROTOCOL) [1]0A80.0D54::10/08/2010-16:13:36.685.00000479 (S4,SipMessage.DataLoggingHelper:118.idx(531))
>>>>>>>>>>>>Outgoing SipMessage c=[<SipTlsConnection_17E4516>], 10.124.0.121:5061->10.124.0.120:61769
SIP/2.0 500 Internal Server Error
FROM: "OCS ONE"<sip:[email protected]>;tag=4b3f58d59f;epid=b566c6d8b3
TO: <sip:me@home>;tag=b47516a517
CSEQ: 1 SUBSCRIBE
CALL-ID: fa199d310f0a4452a6ab8214dacdd406
VIA: SIP/2.0/TLS 10.124.0.120:61769;branch=z9hG4bKE1398849.89445100022DE327;branched=FALSE,SIP/2.0/TLS 10.123.2.191:52650;ms-received-port=52650;ms-received-cid=BE00
CONTENT-LENGTH: 0
SERVER: RTCC/3.5.0.0
------------EndOfOutgoing SipMessage