Answered Help ! Can't find endpoints.

  • Friday, March 16, 2012 4:01 AM
     
     

    Hi,all

    I create NLB for two Lync F-E servers , then i run this MSPL:

     foreach (dbEndpoint in QueryEndpoints(To,true))
        {
             totalEndpoints = totalEndpoints + 1;
         }         
        if (totalEndpoints == 0)
        {
            userOffline = true;
        }

    totalEndpoints  allways is 0 , i have already set second parameter 'true' ,QueryEndpoints(To,true)

    Thank you

All Replies

  • Monday, March 19, 2012 5:04 PM
     
     

    ?

  • Thursday, March 22, 2012 5:13 AM
     
     
    Are you running the MSPL on all the FE servers?  What SIP message are you using to invoke your MSPL app?

    Oscar Newkerk

    Oscarnew Consulting

  • Saturday, March 31, 2012 5:47 PM
     
     

    Whar are you using for "To" as a parameter to QueryEndpoints?

    It should be the RequestTarget.Uri, and I always set the last parameter to false...

  • Thursday, April 05, 2012 9:44 AM
     
     

    Hi ,Competella AB

    To = GetUri(sipRequest.To)

    Thanks

  • Thursday, April 05, 2012 9:47 AM
     
     

    Hi ,Oscarnew Consulting

    yes,i running the MSPL app on all the F-E servers.

    and the entire MSPL :

    <?xml version="1.0"?>
    <r:applicationManifest r:appUri="http://ocspool.binqsoft.com/ModifyHeaders" xmlns:r="http://schemas.microsoft.com/lcs/2006/05">
    <r:allowRegistrationBeforeUserServices/>
    <r:requestFilter methodNames="MESSAGE,INVITE"  strictRoute="true"  domainSupported="false"/>
    <r:responseFilter reasonCodes="ALL" />
    <r:splScript>
    <![CDATA[
    if (sipRequest)

        To = GetUri(sipRequest.To);
         totalEndpoints = 0;
         userAvailable = false;
         userOffline = false;
      
        foreach (dbEndpoint in QueryEndpoints(To,ture))
        {
             totalEndpoints = totalEndpoints + 1;
             publication = QueryCategory(To, 2, "state", dbEndpoint.Instance);
             if (IndexOfString(publication, "3500") >= 0)
             {
                   userAvailable = true;
             }
         }         
        if (totalEndpoints == 0)
         {
            userOffline = true;
            Dispatch("OnRequest");
         } 
    }
    else
    {   
        Dispatch("OnResponse");
    }]]>
    </r:splScript>
    </r:applicationManifest>


  • Thursday, April 05, 2012 9:53 AM
     
     
    Btw , The NLB is created used by hardware .
  • Thursday, April 05, 2012 6:01 PM
     
     

    I do it like this in INVITEs:

            queryUri = RequestTarget.Uri;

           // other code, not relevant

            foreach (dbEndpoint in QueryEndpoints(queryUri, false ))
            {
                totalEndpoints = totalEndpoints + 1;
            }

  • Wednesday, July 04, 2012 2:03 PM
     
     

    Hi, i cannot understand what " >=0" stand for into " if (IndexOfString(publication, "3500") >= 0) "

    I cannot find into MS MDS documentation.

    Thanks

  • Friday, July 06, 2012 3:55 PM
     
     Answered

    That code is checking for the presence <Availability> element to be 3500 which is online and available.  Details of the various values are here:  Introducing Enhanced Presence


    Oscar Newkerk

    Oscarnew Consulting

  • Monday, July 09, 2012 6:29 AM
     
     

    Thanks Oscarn for reply.

    I know about 3500 and  " Enhanced Presence"'s codes. I was just focused into " >=0" snippet of code. 

    So It only means : ok, check if 3500, or whatever, is present and is greater then 0. Right?

    Thanks

  • Monday, July 09, 2012 3:04 PM
     
     Answered Has Code

    The code:

    IndexOfString(publication, "3500") >= 0

    looks at the string"publication" and finds the index/location of the string "3500".  If the index is non-zero then the string contains "3500" and it assigns true to the userAvailable variable.


    Oscar Newkerk

    Oscarnew Consulting