locked
Errors when using Lync Server SDK MSPL Sample "SipSnoop" RRS feed

  • Question

  • Hello

    I wanted to try the SipSnoop sample from the Lync Server SDK. After being mislead by two documentation errors in the SDK's helpfile I managed to ge a running sample up to the point where the Server Agent should be started. This fails then.

    I registered the application on the server with PS-script:

    New-CsServerApplication -Identity "registrar:servername.ourdomain.com/SIPSnoop" -Uri "http://www.microsoft.com/LC/SDK/Samples/SIPSnoop" -Critical $False -Enabled $True
    


    Application Manifest:

    <?xml version="1.0"?>
    <lc:applicationManifest appUri="http://www.microsoft.com/LC/SDK/Samples/SIPSnoop" xmlns:lc="http://schemas.microsoft.com/lcs/2006/05">
     <lc:allowRegistrationBeforeUserServices/>
     <lc:serverFilter roles="ALL"/>
     <lc:requestFilter methodNames="ALL"/>
     <lc:responseFilter reasonCodes="ALL"/>
     <lc:splScript><![CDATA[
     if (sipRequest)
     {
        DispatchNotification("RequestNotificationHandler", sipRequest.Method, sipRequest.From, sipRequest.To);
     }
    
     if (sipResponse)
     {
        DispatchNotification("ResponseNotificationHandler", sipResponse.StatusCode, sipResponse.From, sipResponse.To);
     }
     return; 
    ]]></lc:splScript>
    </lc:applicationManifest>
    

    During debugging, the application manifest is successfully loaded and compiled but then the call to create the ServerAgent object fails (see further code details in the SDK's SipSnoop sample:

    try 
    {
    ///try to connect to server
    serverAgent = new ServerAgent(this, applicationManifest);
    }
    

    I get an Exception "Application not authorized" => "Queue could not be created" =>  "Access denied" :

    Microsoft.Rtc.Sip.UnauthorizedException was caught
     Message=Application not authorized.
     Source=ServerAgent
     StackTrace:
        at Microsoft.Rtc.Sip.ServerAgent.Initialize(ApplicationManifest manifest, Boolean scriptOnly)
        at LyncLoggerRunner.Sessions.SessionManager.ConnectToServer(String manifestFile, String applicationName, String& appGuid) in C:\LyncServerAPI\LyncServer2010Samples\LyncLoggerRunner\SessionManager.cs:line 245
        at LyncLoggerRunner.Logger.ToggleConnection(String toggleReason) in C:\LyncServerAPI\LyncServer2010Samples\LyncLoggerRunner\Logger.cs:line 218
     InnerException: 
        Message=Queue could not be created.
        Source=ServerAgent
        StackTrace:
          at Microsoft.Rtc.Sip.Impl.Queue.ReportError(Int32 status, String genericDescription)
          at Microsoft.Rtc.Sip.ServerAgent.Initialize(ApplicationManifest manifest, Boolean scriptOnly)
        InnerException: System.Security.SecurityException
          Message=Access denied.
          InnerException: 
    

     

    I have the code for the SipSnoop sample in a simple Windows Forms application and want to move later to a windows service. I start the exe on the Lync Server and see the execpetion as soon i hit the "Connect to server" button.

    Things I checked:

    Added then the user with whom I log in to the server to the RTC groups as recommended in articles where other users had problems.
    => No effect

    Restarted the server
    => no effect

    Checked wheter MSMQ is installed in Active Directory Mode
    => Was OK

    Started Sip Logger with the following result

    TL_INFO(TF_COMPONENT) [0]07AC.1F4C::06/27/2011-07:37:04.674.000014c7 (ServerAgent,ObjectTable.constructor:objectmanager.cs(65))ObjectTable for App [http://www.microsoft.com/LC/SDK/Samples/SIPSnoop] - 0x[20f9772] created
    TL_INFO(TF_COMPONENT) [0]07AC.1F4C::06/27/2011-07:37:04.674.000014c8 (ServerAgent,ServerAgent.Initialize:serveragent.cs(554))(00000000028C5305)Initializing application [http://www.microsoft.com/LC/SDK/Samples/SIPSnoop], this[28c5305]
    TL_INFO(TF_COMPONENT) [0]07AC.0E40::06/27/2011-07:37:04.690.000014c9 (ServerAgent,ServerAgent.Dispose:serveragent.cs(3915))(00000000003A9F0C)ServerAgent Final Dispose: this[3a9f0c]
    TL_INFO(TF_COMPONENT) [0]07AC.0E40::06/27/2011-07:37:04.690.000014ca (ServerAgent,ServerAgent.Dispose:serveragent.cs(3915))(00000000031D2B0C)ServerAgent Final Dispose: this[31d2b0c]
    TL_INFO(TF_COMPONENT) [0]0CD0.0CD4::06/27/2011-07:37:04.831.000014d1 (LcsServer,CService::ServiceCtrlHandler:Server.cpp(1424))( 00000000003C0F30 ) SetServiceStatus 4
    TL_ERROR(TF_COMPONENT) [0]07AC.1F4C::06/27/2011-07:37:04.893.000014d2 (QueueDLL,RtlCreateQueue:queue.c(934))Failed to create file mapping (‰lobal\Microsoft.Sip.Buffer.SA.d8cd6fcd-cc12-4284-ad39-900357d58276) :5(ERROR_ACCESS_DENIED)
    TL_ERROR(TF_COMPONENT) [0]07AC.1F4C::06/27/2011-07:37:04.893.000014d3 (QueueDLL,RtlCreateQueue:queue.c(1118))Exit, 5(ERROR_ACCESS_DENIED)
    TL_ERROR(TF_COMPONENT) [0]07AC.1F4C::06/27/2011-07:37:04.893.000014d4 (ServerAgent,ExceptionWpp.WriteLine:exceptiontracer.cs(51))An exception 'System.Exception' was thrown at '  at Microsoft.Rtc.Sip.Impl.Queue.ReportError(Int32 status, String genericDescription)
      at Microsoft.Rtc.Sip.ServerAgent.Initialize(ApplicationManifest manifest, Boolean scriptOnly)'. Message 'Queue could not be created. [INNER MESSAGE START] Access denied. [INNER MESSAGE END] [INNER STACK START] [INNER STACK END]'
    
    


    If anybody knows what to do now.....?

    Regards
    Ben





     

    Monday, June 27, 2011 8:37 AM

Answers

  • One has to start the sample in a command prompt started with elevated privileges ("run as administrator"). This makes sense, since all programs should run with administrator rights....err...

     

    • Marked as answer by zuiopl Wednesday, July 13, 2011 8:14 AM
    Wednesday, July 13, 2011 8:14 AM

All replies

  • One has to start the sample in a command prompt started with elevated privileges ("run as administrator"). This makes sense, since all programs should run with administrator rights....err...

     

    • Marked as answer by zuiopl Wednesday, July 13, 2011 8:14 AM
    Wednesday, July 13, 2011 8:14 AM
  • Try to run The Visual Studio with administrator privileges

    1. Run the *.exe of the application from the bin folder by "run as administrator"

    2. Start to attach the *.exe to the debugger from "Debug ==> Attach to process"

    3. the visual studio will ask you to start with the administrator previlege

     

    I wish this may help

    • Proposed as answer by MohamedSakr Thursday, December 8, 2011 11:06 AM
    Thursday, December 8, 2011 10:56 AM
  • If you are receiving this error: Queue could not be created" => "Access denied" : You need to add your account to the Local RTC Server Applications group.
    Keith Kabza
    Saturday, December 10, 2011 4:16 PM