Configure Brekeke PBX for Lync or OCS
Note: in this instruction, Mediation Server’s IP addresses are 10.1.10.50 (Inbound: Brekeke PBX -> OCS) and 10.1.10.30 (Outbound: OCS -> Brekeke PBX).
Add the following DialPlan rules in Brekeke PBX bundled SIP Server on top of other rules.
For Brekeke PBX v3.x
Rule-1: From OCS to PBX
------------------------------------- [Matching Patterns:] $addr = 10.1.10.30 $request = ^INVITE $getUri( From ) = sip:(.+)@(.+) $getUri( To ) = sip:\+(.+) $pbx.inport = (.+) [Deploy Patterns:] $target = 127.0.0.1:%4 $transport = UDP $auth = false &net.sip.transport.follow.request = true &net.sip.fixed.addrport.uas = true From = sip:%1_ocs@%2 To = sip:%3 ----------------------------------------
(If an INVITE packet came from the OCS Mediation Server, the Brekeke SIP Server adds “_ocs” in the From URI and forwards the packet to the Brekeke PBX.)
Rule-2: From PBX to OCS
-------------------------- [Matching Patterns:] $pbx.src = ^true $registered = false $outbound = false $request = ^INVITE $getUri( From ) = !_ocs To=sip:(.+)@ [Deploy Patterns:] $transport = TCP $auth = false &net.sip.transport.follow.request = true &net.sip.fixed.addrport.uas = true To = sip:+%1@10.1.10.50 --------------------------
(If an INVITE packet came from the Brekeke PBX and the destination URI is not registered and the From URI doesn’t contain “_ocs”, the Brekeke SIP Server forwards the packet to the OCS Mediation Server.)
Rule-3: From PBX from OCS
------------------------ [Matching Patterns:] $pbx.src = ^true $request = ^INVITE $getUri( From ) = sip:(.+)_ocs@(.+) [Deploy Patterns:] $replaceuri = true $continue = true From = sip:%1@%2 ----------------------------
(If an INVITE packet came from the Brekeke PBX and the From URI contains “_ocs”, the Brekeke SIP Server removes “_ocs” from the URI and forwards the packet to the destination user.)
For Brekeke PBX v2.x
Rule-1: From OCS to PBX
------------------------------------- [Matching Patterns:] $addr = 10.1.10.30 $request = ^INVITE $getUri( From ) = sip:(.+)@(.+) $getUri( To ) = sip:\+(.+) [Deploy Patterns:] $target = localhost:15060 $transport = UDP $auth = false &net.sip.transport.follow.request = true &net.sip.fixed.addrport.uac = true From = sip:%1_ocs@%2 To = sip:%3 ----------------------------------------
(If an INVITE packet came from the OCS Mediation Server, the Brekeke SIP Server adds “_ocs” in the From URI and forwards the packet to the Brekeke PBX.)
Rule-2: From PBX to OCS
-------------------------- [Matching Patterns:] $port = 15062 $localhost = true $registered = false $outbound = false $request = ^INVITE $getUri( From ) = !_ocs To=sip:(.+)@ [Deploy Patterns:] $transport = TCP $auth = false &net.sip.transport.follow.request = true &net.sip.fixed.addrport.uas = true To = sip:+%1@10.1.10.50 --------------------------
(If an INVITE packet came from the Brekeke PBX and the destination URI is not registered and the From URI doesn’t contain “_ocs”, the Brekeke SIP Server forwards the packet to the OCS Mediation Server.)
Rule-3: From PBX from OCS
------------------------ [Matching Patterns:] $port = 15062 $localhost = ^true $request = ^INVITE $getUri( From ) = sip:(.+)_ocs@(.+) [Deploy Patterns:] $replaceuri = true $continue = true From = sip:%1@%2 ----------------------------
(If an INVITE packet came from the Brekeke PBX and the From URI contains “_ocs”, the Brekeke SIP Server removes “_ocs” from the URI and forwards the packet to the destination user.)