user agent client (uac) user agent server (uas)

79

Upload: louise-shields

Post on 17-Dec-2015

261 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: User Agent Client (UAC) User Agent Server (UAS)
Page 2: User Agent Client (UAC) User Agent Server (UAS)

Michael GreenleeLead UC ArchitectClarity Consulting

Compliance, Message Routing, Filtering and More: Lync Server SDK

PLAT400

Vijay ManianSenior Development LeadMicrosoft Corporation

Page 3: User Agent Client (UAC) User Agent Server (UAS)

Routing in Lync Server

Page 4: User Agent Client (UAC) User Agent Server (UAS)

Session Initiation Protocol (SIP)Standardized protocol for UC messagingDefined in RFC 3261http://www.ietf.org/rfc/rfc3261.txt

Lync adds some extensions for presence, conferencinghttp://msdn.microsoft.com/en-us/library/cc339480(v=office.12).aspx

Can interoperate between Lync and other SIP-based platformsCaveat: Lync does SIP over TCP/TLS rather than UDP

Page 5: User Agent Client (UAC) User Agent Server (UAS)

SIP messageFirst lineHeaders (Name: Value)BodyCan be request or responseRequest has a methodINVITE, REGISTER

Response has a code200, 301, 404

Page 6: User Agent Client (UAC) User Agent Server (UAS)

User agentNetwork endpoint that sends or receives SIP messages on behalf of a user.

Page 7: User Agent Client (UAC) User Agent Server (UAS)

User agent

User Agent Client (UAC)

User Agent Server(UAS)

Page 8: User Agent Client (UAC) User Agent Server (UAS)

User agent

User Agent Server(UAS)

User Agent Client(UAC)

Page 9: User Agent Client (UAC) User Agent Server (UAS)

SIP URI

sip:[email protected]

Page 10: User Agent Client (UAC) User Agent Server (UAS)

SIP URI

Logical Physical

vs.

Page 11: User Agent Client (UAC) User Agent Server (UAS)

SIP URI

Logical Physical

vs.

sip:[email protected] sip:[email protected]

Page 12: User Agent Client (UAC) User Agent Server (UAS)

Proxy server

Page 13: User Agent Client (UAC) User Agent Server (UAS)

Proxy server

Proxy

RegistrarLocation Server

Page 14: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected]: sip:[email protected]: sip:[email protected]

To/FromRequest URI

Page 15: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected]: sip:[email protected]: sip:[email protected]

To/From

Page 16: User Agent Client (UAC) User Agent Server (UAS)

sip:[email protected];key1=value;key2;key3=value:value

URI parameters

Page 17: User Agent Client (UAC) User Agent Server (UAS)

Forking

Proxy

INVITE

INVITE

INVITE

200 OK

200 OK

CANCEL

Page 18: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected]: sip:[email protected];tag=5B52BDATo: sip:[email protected];tag=062AG2B

Tags

Page 19: User Agent Client (UAC) User Agent Server (UAS)

Globally Routable User Agent URIUniquely identifies a specific user agentRoutable from anywhereContains the gruu parameter in the URI

GRUUs

Page 20: User Agent Client (UAC) User Agent Server (UAS)

Also known as “SIP dialog”Tied together by Call-ID headerUniquely identified by Call-ID plus from and to tagsStarts with INVITE, ends with BYE

SIP session

Page 21: User Agent Client (UAC) User Agent Server (UAS)

Message routing walkthrough

Page 22: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 23: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 24: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 25: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 26: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 27: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 28: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

Page 29: User Agent Client (UAC) User Agent Server (UAS)

Perform routing and other tasksRoute messages to one another using request URILocated in the Server\Core directory

Front End Services

Page 30: User Agent Client (UAC) User Agent Server (UAS)

ClientVersionFilterTranslationServiceInboundRouting / DefaultRoutingUserServicesOutboundRoutingEtc.

Front End Services

Page 31: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

TranslationService

Page 32: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

UserServices/InterClusterRouting

Page 33: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:[email protected] SIP/2.0From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Via: SIP/2.0/TLS 192.168.100.163:49243Max-Forwards: 70Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==ms-keep-alive: UAC;hop-hop=yesAllow: INVITE, BYE, ACK, CANCEL, INFO, UPDATE, REFER, NOTIFY, BENOTIFY, OPTIONSms-subnet: 192.168.100.0Accept-Language: en-USms-endpoint-location-data: NetworkScope;ms-media-location-type=Intranet

INVITE

InboundRouting

Page 34: User Agent Client (UAC) User Agent Server (UAS)

InboundRouting

101 Progress Report

SIP/2.0 101 Progress ReportFrom: "Michael Greenlee"<sip:[email protected]>;tag=25ed2084fd;epid=99479001a4To: <sip:[email protected]>CSeq: 1 INVITECall-ID: cfddfdafd2904102981a259f506a83ffAuthentication-Info: …Content-Length: 0Via: SIP/2.0/TLS 192.168.100.163:49243;ms-received-port=49243;ms-received-cid=2400ms-diagnostics: 13004;reason="Request was proxied to one or more registered endpoints";source="cctest-lync-02.cclab.internal";Count="1";appName="InboundRouting"Server: InboundRouting/4.0.0.0

Page 35: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:192.168.100.163:49526;transport=tls;ms-opaque=1ee5c33e9d;ms-received-cid=3F200 From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: sip:[email protected];epid=8a00958032 CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Record-Route: <sip:cctest-lyncpool-01.cclab.internal:5061;transport=tls;ms-fe=cctest-lync-02.cclab.internal;opaque=state:T:F:Ci.R3f200;lr;ms-route-sig=aamklZ7YmPrsCecMhQ0J0_9cE6QKHMO9lD1jfGgdRlNlGZyrM4NVmY5gAA>;tag=990C7A726842881A248A9D9BA48C69B3Via: SIP/2.0/TLS 192.168.100.163:49243Via: SIP/2.0/TLS 192.168.100.152:5061;branch=z9hG4bK0C4264F9.38B3CA99D96E73A7;branched=TRUEMax-Forwards: 69Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==…

INVITE

Page 36: User Agent Client (UAC) User Agent Server (UAS)

INVITE sip:192.168.100.163:49526;transport=tls;ms-opaque=1ee5c33e9d;ms-received-cid=3F200 From: <sip:[email protected]>;tag=f2e91c214e;epid=99479001a4To: sip:[email protected];epid=8a00958032 CSeq: 1 INVITECall-ID: 474db87e9ee44b288047254ebc8ce6e7Record-Route: <sip:cctest-lyncpool-01.cclab.internal:5061;transport=tls;ms-fe=cctest-lync-02.cclab.internal;opaque=state:T:F:Ci.R3f200;lr;ms-route-sig=aamklZ7YmPrsCecMhQ0J0_9cE6QKHMO9lD1jfGgdRlNlGZyrM4NVmY5gAA>;tag=990C7A726842881A248A9D9BA48C69B3Via: SIP/2.0/TLS 192.168.100.163:49243Via: SIP/2.0/TLS 192.168.100.152:5061;branch=z9hG4bK0C4264F9.38B3CA99D96E73A7;branched=TRUEMax-Forwards: 69Contact: <sip:[email protected];opaque=user:epid:F0kyMXrgcVG7AGiFOkX1AAAA;gruu>User-Agent: UCCAPI/15.0.4517.1004 OC/15.0.4517.1004 (Microsoft Lync)Supported: ms-dialog-route-set-updateMs-Conversation-ID: Ac6O1+2jz+e9yLIhSESaW5HSxAxLNQ==…

INVITE

Page 37: User Agent Client (UAC) User Agent Server (UAS)

Lync Server SDK

Page 38: User Agent Client (UAC) User Agent Server (UAS)

ScenariosFilter or block certain trafficModify message contentReroute messages to a UCMA applicationIntegrate third-party devices or softwareFine-tune PSTN or federation behaviour

Page 39: User Agent Client (UAC) User Agent Server (UAS)

ArchitectureRuns on Front End Server (or Edge Server)Handles messages as they are being routedInstalled/configured using Lync Management ShellCan be script-only or managed

Page 40: User Agent Client (UAC) User Agent Server (UAS)

WARNING!You can seriously mess up Lync Server routing with these APIsMake sure to test in a lab environment for both stability and performance

Page 41: User Agent Client (UAC) User Agent Server (UAS)

Two types of applicationsScript-onlyEntirely contained in manifest fileHigher performanceCannot delete or modify existing SIP headersCan’t reference external resources (except text file)Best for simple routing tasks

ManagedGenerally deployed as a Windows serviceNeed to be careful of performance impactCan modify, add, remove headers, modify message bodyCan reference external resources (e.g., database)Best for modifying messages, complex routing, anything that requires external data

Page 42: User Agent Client (UAC) User Agent Server (UAS)

Manifest fileText file with .am extension deployed on Front EndContains XML document with application attributes and script

Page 43: User Agent Client (UAC) User Agent Server (UAS)

Manifest file<?xml version="1.0"?><r:applicationManifestr:appUri="http://www.microsoft.com/LC/SDK/Samples/ContentModification"xmlns:r="http://schemas.microsoft.com/lcs/2006/05">

<r:requestFilter methodNames="INVITE,MESSAGE" strictRoute="true" registrarGenerated="false" domainSupported="false"/><r:responseFilter reasonCodes="NONE"/>

<r:scriptOnly/>

<r:splScript>…

Page 44: User Agent Client (UAC) User Agent Server (UAS)

Manifest file<?xml version="1.0"?><r:applicationManifestr:appUri="http://www.microsoft.com/LC/SDK/Samples/ContentModification"xmlns:r="http://schemas.microsoft.com/lcs/2006/05">

<r:requestFilter methodNames="INVITE,MESSAGE" strictRoute="true" registrarGenerated="false" domainSupported="false"/><r:responseFilter reasonCodes="NONE"/>

<r:scriptOnly/>

<r:splScript>…

Page 45: User Agent Client (UAC) User Agent Server (UAS)

Manifest file<?xml version="1.0"?><r:applicationManifestr:appUri="http://www.microsoft.com/LC/SDK/Samples/ContentModification"xmlns:r="http://schemas.microsoft.com/lcs/2006/05">

<r:requestFilter methodNames="INVITE,MESSAGE" strictRoute="true" registrarGenerated="false" domainSupported="false"/><r:responseFilter reasonCodes="NONE"/>

<r:scriptOnly/>

<r:splScript>…

Page 46: User Agent Client (UAC) User Agent Server (UAS)

Manifest file<requestFilter>Determines which SIP requests get handled by the scriptCan filter by SIP methodSupported domain flagStrict route flag

<responseFilter>Determines which SIP responses get handled by the scriptCan filter by SIP response code

<scriptOnly>Included if there is no managed code components

Page 47: User Agent Client (UAC) User Agent Server (UAS)

Manifest file<?xml version="1.0"?><r:applicationManifestr:appUri="http://www.microsoft.com/LC/SDK/Samples/ContentModification"xmlns:r="http://schemas.microsoft.com/lcs/2006/05">

<r:requestFilter methodNames="INVITE,MESSAGE" strictRoute="true" registrarGenerated="false" domainSupported="false"/><r:responseFilter reasonCodes="NONE"/>

<r:scriptOnly/>

<r:splScript>…

Page 48: User Agent Client (UAC) User Agent Server (UAS)

Manifest file<?xml version="1.0"?><r:applicationManifestr:appUri="http://www.microsoft.com/LC/SDK/Samples/ContentModification"xmlns:r="http://schemas.microsoft.com/lcs/2006/05">

<r:requestFilter methodNames="INVITE,MESSAGE" strictRoute="true" registrarGenerated="false" domainSupported="false"/><r:responseFilter reasonCodes="NONE"/>

<r:scriptOnly/>

<r:splScript>…

Page 49: User Agent Client (UAC) User Agent Server (UAS)

SPL scriptSPL = SIP Processing LanguageAlso known as MSPLC#-like syntax with limited set of functions, preset variablesCan access the request or response data and perform simple routing functions

Page 50: User Agent Client (UAC) User Agent Server (UAS)

SPL scriptProxyRequestSend a request alongLeave parameter blank to send to original destinationInclude a parameter to send to a specific physical location

ProxyResponseSend a response along

BeginFork/Fork/EndForkSend a request to multiple locationsOnly one of the receiving endpoints needs to respond

RespondSend a response to the request without proxying it anywhereCan be used to block or forward requests

Page 51: User Agent Client (UAC) User Agent Server (UAS)

SPL scriptLog("Debug", false, "");Log("Debug", false, "Entering ContentModification.am");

index = IndexOfString(sipRequest.Content, "echo");

if (index == -1) { /* * Not found; no-op */}else{ sipRequest.Content = Concatenate(sipRequest.Content, " (echo.)"); Log("Debug", false, " Message body matched substring; modified content");}

ProxyRequest("");

Page 52: User Agent Client (UAC) User Agent Server (UAS)

SPL scriptLog("Debug", false, "");Log("Debug", false, "Entering ContentModification.am");

index = IndexOfString(sipRequest.Content, "echo");

if (index == -1) { /* * Not found; no-op */}else{ sipRequest.Content = Concatenate(sipRequest.Content, " (echo.)"); Log("Debug", false, " Message body matched substring; modified content");}

ProxyRequest("");

Page 53: User Agent Client (UAC) User Agent Server (UAS)

SPL scriptLog("Debug", false, "");Log("Debug", false, "Entering ContentModification.am");

index = IndexOfString(sipRequest.Content, "echo");

if (index == -1) { /* * Not found; no-op */}else{ sipRequest.Content = Concatenate(sipRequest.Content, " (echo.)"); Log("Debug", false, " Message body matched substring; modified content");}

ProxyRequest("");

Page 54: User Agent Client (UAC) User Agent Server (UAS)

SPL scriptLog("Debug", false, "");Log("Debug", false, "Entering ContentModification.am");

index = IndexOfString(sipRequest.Content, "echo");

if (index == -1) { /* * Not found; no-op */}else{ sipRequest.Content = Concatenate(sipRequest.Content, " (echo.)"); Log("Debug", false, " Message body matched substring; modified content");}

ProxyRequest("sip:[email protected];gruu;opaque=srvr:presencetester:KE_GakuhUl-NoJitcGMskwAA");

Page 55: User Agent Client (UAC) User Agent Server (UAS)

SIP Application APIA.k.a. Managed SPL.NET API for handling SIP messages en route through the Front End or EdgeSuperset of the capabilities of SPLCan be slower because it’s a managed code APIMust be used in conjunction with an SPL script

Page 56: User Agent Client (UAC) User Agent Server (UAS)

SIP Application API – SPL methodsDispatchSend a message to managed code for an SPL script for further handlingCan specify managed code method name and extra parameters

DispatchNotificationCall a method in managed code with message info, but continue routing the messageGood for passing data to managed code for processing without impacting performance

Page 57: User Agent Client (UAC) User Agent Server (UAS)

Dispatching to managed codeif (sipRequest.StandardMethod == StandardMethod.Invite){

if (GetParameterValue(sipRequest.To, "tag") != null){

return;}

queryUri = RequestTarget.Uri;targetAOR = QueryAddressOfRecord(queryUri);

fromUserUri = GetUri(sipRequest.From); fromUserAOR = QueryAddressOfRecord(fromUserUri);

Dispatch("RequestInviteHandler", targetAOR, fromUserAOR );}

Page 58: User Agent Client (UAC) User Agent Server (UAS)

Dispatching to managed codeif (sipRequest.StandardMethod == StandardMethod.Invite){

if (GetParameterValue(sipRequest.To, "tag") != null){

return;}

queryUri = RequestTarget.Uri;targetAOR = QueryAddressOfRecord(queryUri);

fromUserUri = GetUri(sipRequest.From); fromUserAOR = QueryAddressOfRecord(fromUserUri);

Dispatch("RequestInviteHandler", targetAOR, fromUserAOR );}

Page 59: User Agent Client (UAC) User Agent Server (UAS)

Managed SPLpublic void RequestInviteHandler(object sender, RequestReceivedEventArgs eventArgs){ ServerTransaction srvTran = eventArgs.ServerTransaction; Request request = eventArgs.Request; … string targetAor = eventArgs.Parameters[0] as string; string sourceAor = eventArgs.Parameters[1] as string;

if (IsCrossingEthicalWall(sourceAor, targetAor)) { Console.Out.WriteLine("Rejecting Request."); Response resp = request.CreateResponse(403); srvTran.SendResponse(resp); return; }…

Page 60: User Agent Client (UAC) User Agent Server (UAS)

Managed SPLpublic void RequestInviteHandler(object sender, RequestReceivedEventArgs eventArgs){ ServerTransaction srvTran = eventArgs.ServerTransaction; Request request = eventArgs.Request; … string targetAor = eventArgs.Parameters[0] as string; string sourceAor = eventArgs.Parameters[1] as string;

if (IsCrossingEthicalWall(sourceAor, targetAor)) { Console.Out.WriteLine("Rejecting Request."); Response resp = request.CreateResponse(403); srvTran.SendResponse(resp); return; }…

Page 61: User Agent Client (UAC) User Agent Server (UAS)

Managed SPLpublic void RequestInviteHandler(object sender, RequestReceivedEventArgs eventArgs){ ServerTransaction srvTran = eventArgs.ServerTransaction; Request request = eventArgs.Request; … string targetAor = eventArgs.Parameters[0] as string; string sourceAor = eventArgs.Parameters[1] as string;

if (IsCrossingEthicalWall(sourceAor, targetAor)) { Console.Out.WriteLine("Rejecting Request."); Response resp = request.CreateResponse(403); srvTran.SendResponse(resp); return; }…

Page 62: User Agent Client (UAC) User Agent Server (UAS)

Lync Management ShellNeed to set up and enable server application in Lync environment using Management Shell*-CsServerApplication

Page 63: User Agent Client (UAC) User Agent Server (UAS)

*-CsServerApplicationIdentityIndicates pool the application is on, and application name

UriMust match URI in the manifest file

ScriptNameFor script-only applications, the path to the manifest file

PriorityOrder in which applications get to handle messages – lower numbers get higher priority

CriticalIf true, the Front End service won’t start if this application can’t be loaded

Page 64: User Agent Client (UAC) User Agent Server (UAS)

TroubleshootingScript-onlyCheck script path in Management ShellMake sure application is enabledMake sure URI matches between Management Shell and manifest fileCheck event log for errors from LS Script-Only ApplicationsMake sure <scriptOnly/> element is presentUse APILogger.exe

ManagedMake sure application is running under the right service accountCheck service account group assignments and permissionsMake sure application is enabledMake sure manifest file is in the right directoryLog to the console or the event log in your codeCheck event log for errors loading your applicationCollect RTCSPL logs with Lync Server Logging Tool

Page 65: User Agent Client (UAC) User Agent Server (UAS)

Demo: Message filtering

Vijay Manian

Page 66: User Agent Client (UAC) User Agent Server (UAS)

Demo: Redirect

Vijay Manian

Page 67: User Agent Client (UAC) User Agent Server (UAS)

Demo: Modifying content

Vijay Manian

Page 68: User Agent Client (UAC) User Agent Server (UAS)

Resources

MSDN documentationhttp://msdn.microsoft.com/en-us/library/office/dn454964.aspx

SDK downloadhttp://www.microsoft.com/en-ca/download/details.aspx?id=35456

Page 69: User Agent Client (UAC) User Agent Server (UAS)

Q&A

Page 70: User Agent Client (UAC) User Agent Server (UAS)

Thank you

Page 71: User Agent Client (UAC) User Agent Server (UAS)
Page 72: User Agent Client (UAC) User Agent Server (UAS)

Monday, February 17th

Exhibit Hall Hours 6:00pm – 8:00pm

6:00pm – 8:00pm Welcome Reception

Tuesday, February 18th

Exhibit Hall Hours 8:00am – 9:00am (Breakfast), 10:30am – 5:00pm

8:00am – 9:00am Breakfast (Exhibit Hall) 9:00am –10:30am General Session10:30am – 5:00pm Expo Hall Hours11:00am – 12:15pm Sessions & Hands-on Labs12:15pm – 2:00pm Lunch2:00pm – 5:00pm Sessions & Hands-on Labs5:00pm – 7:00pm Ask the Experts

Wednesday, February 19th

Exhibit Hall Hours 10:30am – 4:30pm

7:30am – 8:30am Breakfast8:30am – 11:30am Sessions & Hands-on Labs10:30am – 4:30pm Expo Hall Hours11:30am – 1:00pm Lunch1:00pm – 5:45pm Sessions & Hands-on Labs6:30pm – 9:30pm Attendee Party

Thursday, February 20th

Exhibit Hall Hours 9:00am – 12:00pm

8:00am – 9:00am Breakfast9:00am – 12:00pm Expo Hall Hours9:00am – 12:15pm Sessions & Hands-on Labs12:15pm – 1:30pm Lunch and Departures

Page 73: User Agent Client (UAC) User Agent Server (UAS)

Ask the ExpertsLocation: Meal Hall located on Level 1 in Pinyon Ballroom 4-8 Tuesday, February 18

TABLE TOPICS:Best Practices, Business Value, Clients & Mobility, Lync Meetings and Video, Lync Online, Networking, Platform, Server & Manageability, Voice, Lync Feedback Sessions

Meet face-to-face with the foremost experts in the Lync field and ask them the questions that have you stumped.

Page 74: User Agent Client (UAC) User Agent Server (UAS)

Location: Breakout rooms located on Level 1 5:00pm-7:00pm

GROUPS INCLUDE:Manageability – Pinyon 2Meetings & Web Experiences – Bluethorn 4-6Mobility – Bluethorn 7-9Presence & Chat – Pinyon 1Voice & Video – Bluethorn 1-3

Come participate in targeted Feedback Sessions to hear about the high-priority feature asks and help us improve the next release!

Lync Feedback

These sessions are meant to be informational, providing an understanding of the workload and conversational, to discuss your user scenarios and desired improvements.

Page 75: User Agent Client (UAC) User Agent Server (UAS)

Birds of a FeatherBirds of a Feather flock together! Join daily breakfast discussions of relevant topics by sitting in the separately designated areas of the Meal Hall. Seating will be sorted in a different way for each Birds of a Feather breakfast:Wednesday, February 19:Where are you from? Asia/Pacific, Eastern & Central Europe, Latin America, Middle East & Africa, US (West, Central & East) and Canada, Western Europe

Thursday, February 20:What is your interest?Best Practices, Business Value, Clients & Mobility, Lync Meetings and Video, Lync Online, Networking, Platform, Server & Manageability, Voice

Page 76: User Agent Client (UAC) User Agent Server (UAS)

#LyncConf14

/msftLYNC

/microsoft-lync

/MSFTLync

Page 77: User Agent Client (UAC) User Agent Server (UAS)

Lync Launch PadYou’ve launched Lync. Now Launch this.MS Pavilion – Expo Hall

Page 78: User Agent Client (UAC) User Agent Server (UAS)

Fill out evaluations to win prizesFill out evaluations on MyLync or MyLync Mobile.Prizes awarded daily.

Page 79: User Agent Client (UAC) User Agent Server (UAS)

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.