Presentation is loading. Please wait.

Presentation is loading. Please wait.

LCS Server Programmability John Lamb Consultant Microsoft UK.

Similar presentations


Presentation on theme: "LCS Server Programmability John Lamb Consultant Microsoft UK."— Presentation transcript:

1 LCS Server Programmability John Lamb Consultant Microsoft UK

2 Agenda Overview of server APIs Review of existing features Changes in Live Communications Server 2005 Building server applications for maximum performance

3 Server APIs – Overview Expose SIP- No abstraction Allows application to only receive messages it requires Routing and proxy functionality Allow multiple applications to run on one server Do not impose an extensive framework on applications

4 Server APIs Primary components Application manifest SPL Managed extensions (optional) Performance implications in each

5 Component Interaction

6 Application Manifest What? XML formatted document Why? Describes the application to the server Application URI Filtering rules (request type, response class, strict route, etc) SPL container Where? Presented to the server when the application registers First application component to see any message

7 Manifest – Example <r:applicationManifest r:appUri="http://www.microsoft.com/LC/SDK/Samples/Con tentModification" xmlns:r="http://schemas.microsoft.com/lcs/2004/05"> <r:requestFilter methodNames="INVITE,MESSAGE" strictRoute="true" registrarGenerated="false" domainSupported="false"/> <![CDATA[

8 SPL What? SPL- SIP processing language Why? Easy to use scripting language able to write powerful filter and routing rules Syntax similar to C# Very limited set of capabilities(Ex- no looping, static variables, or arithmetic) Where? Messages that pass the manifest Runs in process

9 SPL - SIP support Access to SIP message components providing capabilities Filtering Response codes (Ex- 302) Headers contents (Ex- helpdesk@foo.com) Routing Proxy and respond Simple message modification Add/modify headers Change message content Access to endpoint data

10 SPL – Example <![CDATA[ Log("Debug", false, "Entering ContentModification.am"); userUri = GetUri(sipRequest.To); remoteHost = GetHostName(userUri); If (remoteHost != northwindtraders.com) { index = IndexOfString(sipRequest.Content, guarantee"); …

11 SPL – Example if (index != -1) { sipRequest.Content = Concatenate(sipRequest.Content, "\r\n**** Contoso Financial makes no binding guarantees of future performance***"); Log("Debug", false, " Message body matched substring; modified content"); } } ProxyRequest(""); ]]>

12 Managed APIs What? Managed API-.NET Framework SIP Class Library provides low level access to SIP semantics Why? Building standalone applications Allows application to provide more complex logic than SPL Where? Invoked from within SPL Outside of server process

13 Managed APIs – SIP Support All data available to SPL Messages, header contents Message content.NET facilities available for XML doc parsing, SDP, etc. Additional data Transaction objects Transaction semantics provided by the APIs Event/error handling

14 Managed APIs – Out Of Process Existing app integration Provides SIP awareness to legacy applications Ex- virus scanning, media relay Server security Misbehaved applications Attack vulnerability

15 Managed APIs – Sample <r:applicationManifest r:appUri="http://www.microsoft.com/LCS/Samples/Loggin gNotice" xmlns:r="http://schemas.microsoft.com/lcs/2004/05"> <r:requestFilter methodNames="MESSAGE,ACK" strictRoute="true" registrarGenerated="false" domainSupported="false"/> <![CDATA[ Dispatch("OnRequest"); ]]>

16 Managed APIs – Sample public void OnRequest(object sender, RequestReceivedEventArgs e) { string CallId = GetHeaderValue(e.Request, "Call-Id"); SessionState state = GetSessionState(e.Request); switch (state) { case SessionState.Unknown: if (e.Request.StandardMethod == Request.StandardMethodType.Ack) { UpdateSessionState(CallId, SessionState.ModifyNextIM); } else if (e.Request.StandardMethod == Request.StandardMethodType.Bye) { DeleteState(CallId); } break;

17 Managed APIs – Sample case SessionState.ModifyNextIM: if (e.Request.StandardMethod == Request.StandardMethodType.Message) { string ToAddr = GetHeaderValue(e.Request, "To"); if (!ParticipantWarned(CallId, ToAddr)) { e.Request.Content += "\r\n(*** This conversation may be logged. ***)"; MarkParticipant(CallId, ToAddr); } if (WarnCount(CallId) == 2) { DeleteState(CallId); } }

18 SPL – Performance Minimal impact SPL app should not affect engineered capacity of server Avoid registration data lookup until necessary *More significant perf impact when weighed against Managed APIs

19 Managed APIs – Performance Design wisely for maximum performance Filter via manifest and SPL Dispatch only when necessary By definition, SPL is better performing than Managed APIs

20 Performance – Best Practices Never do in SPL or managed code what you can do in a manifest Bad- <r:requestFilter methodNames="ALL"... if (sipRequest.Method == StandardMethod.MESSAGE) Good- <r:requestFilter methodNames="MESSAGE"...

21 Performance – Best Practices Filter before calling Dispatch() Bad- SPL: Dispatch(); Managed: if (response.statusCode != 200) return; Good- SPL: if (sipResponse.StatusCode == 200) Dispatch();

22 Whats New? Server roles Live Communications Server 2005 feature support Presence Optimizations Server Roles (Topology) Message origin (Access Proxy) Other SPL routing enhancements Presence based routing Flat file access Enhancements to existing objects

23 Whats NOT? UAC Functionality Applications do not have the capability to generate requests WMI Access from SPL Only managed applications can integrate WMI

24 New Features – Server Roles Several new server roles introduced Director, Access Proxy, Forwarding Proxy Each role has unique behavior DMZ Front-EndDirector Outside User Federated Company AD Access Proxy Enterprise Deployment

25 New Features – Server Roles Server applications may run on ANY server role What server should my app be running on? May depend on existing topology Examine message path of target activity Consider data needs Ex- Access Proxy does NOT have access to user database Deploy for performance

26 New Features – Presence Optimizations Recap- BENOTIFY Response- less NOTIFY Subscription piggybacking Embedding presence documents in responses 2003 2005SubscribeResponseNOTIFYResponseNOTIFYResponse SubscribeResponseBENOTIFY

27 New Features – Presence Optimization Support BENOTIFY BENOTIFY added to list of known SIP verbs Any application that inspects NOTIFY requests should inspect BENOTIFY Applications must NOT rely on responses SPL and Managed APIs Subscription piggybacking No specific features added Not ALL presence documents now available to applications in the server pools

28 New Features – Message Stamping Applications may require exchanging state In FE pools Stamping messages so that app runs only once per user (Ex- logging) Exchange state between application instances easily Functions provided for setting stamps and querying for existing stamps SPL and Managed APIs

29 New Features – Message Origin Only relevant to Access Proxy based applications Allows application logic depending upon message entering or leaving the network SPL and Managed APIs Access Proxy Federated Traffic (Outside) Enterprise Traffic (Inside)

30 New Features – Flat File Flat file access (SPL only) Allows SPL scripts access to delimited text files Provides a source for data- name/value pairs (128K max) Example usage- Phone routing tables Specific user set requires special handling

31 New Features – XML access XML document access (SPL only) GetXMLAttr(…) function Useful for Routing based on presence stored in endpoint database Inspection of SERVICE requests Attribute search based on 1st occurrence from XPath provided

32 Additional New Features SPL String operations Header enum- optimized header lookup Dispatch- able to pass additional parameters to managed code null may now be return from several functions Allows applications do differentiate between not found and empty string()

33 Backward Compatibility What about my Live Communications Server 2003 applications? Applications run in 2005 without modification No 2005 changes affect existing application Beware of 2003 app execution in FE pools Modified Applications Manifest must be updated to target 2005 if the applicaton (SPL or managed) is modified to use any 2005 features

34 Additional Info API Documentation on MSDN- http://msdn.microsoft.com/library/en- us/lcs2005/rtc/portal.asp http://msdn.microsoft.com/library/en- us/lcs2005/rtc/portal.asp http://msdn.microsoft.com/library/en- us/lcs2005/rtc/portal.asp Application Deployment Guide (To be published)

35 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "LCS Server Programmability John Lamb Consultant Microsoft UK."

Similar presentations


Ads by Google