Although I had read in the Microsoft blogs Direct SIP with IP-PBX in Office Communications Server 2007 and Reverse Number Lookup and Dealing with Legacy PBX (and had been told the same thing by Duncan Blake, a Unify Square colleague of mine) that OCS 2007 R2 will normalize both the FROM: Calling Party number and TO: Called Party number on incoming PBX and PSTN calls according to the Location Profile rules assigned to the Mediation Server handling the call, incoming call normalization of either number wasn’t working in my lab environment.
After doing SIPStack trace investigations on both my Front End server and Mediation Server, I discovered that my media gateway—a Quintum Tenor AF running P107-09-00 firmware—was adding a “+” to both the TO: and FROM: numbers before routing the INVITE to the Mediation Server. As per RFC 3966, a leading “+” in a TEL: URI indicates that the phone number is globally-unique (i.e., E.164). To OCS, this means that the numbers are already E.164, so it does not attempt to perform any further normalization on them (this same rule also applies to outgoing calls in OCS and Office Communicator).
So the unexpected “+” was why inbound normalization was failing. However, I was still puzzled because the Tenor was not configured to do translations on either the Calling or Called Party numbers, but just to pass what it received from the Telco. I never deliberately configured it to send a “+”. Then it hit me: beginning with P105-19-00 of the firmware, Quintum added support for some configuration parameters that are not exposed in the gateway user interface, but instead are set using a small text file named var_config.cfg.
From the P105-19-00 release notes:
New configuration parameters have been added to enable you to configure a public phone number to have a + at the start, and also for the URI to contain "user=phone". The two new options are available in the var_config.cfg file: SipPrependPlus will add a "+" to any number except a private number in the SIP signaling message. Valid options: 0 (do not add a '+') or 1 (add "+"). SipUserPhone will add "user=phone" to SIP URI parameter list. Valid options: 1 (adds "user=phone" to SIP URI) or 0 (does not add "user=phone").
The default var_config.cfg file for P105-19-00 is:
SipTransportDefault 1
SipPrependPlus 1
SipUserPhone 1
progcause 1
The var_config.cfg file currently on my gateway (that one that Quintum recommends when integrating P107-09-00 Tenors with OCS) was:
SipTransportDefault 1
SipPrependPlus 1
SipUserPhone 1
EarlyMediaRingTone 1
SIPMissingCIDURI anonymous
After changing the second line of my var_config.cfg file to “SipPrependPlus 0” and restarting the gateway, voile! The numbers the Tenor passed to the Mediation Server no longer had the leading “+”, and now OCS’s Inbound Number Translation behaved as expected on both the TO: and FROM: numbers.
I don’t know why Quintum decided to make the SipPrependPlus a default setting, because the only time this would be acceptable would be if you performed E.164 normalization of both the TO: and FROM: numbers on the gateway, before sending the call to OCS.
With my system now working properly, the INVITE from the Tenor gateway looked like this:
INVITE sip:2531234567@192.168.100.22;user=phone SIP/2.0FROM: <sip:4258650709@192.168.100.22;user=phone>;tag=c0a86405-8TO: <sip:2531234567@192.168.100.22;user=phone>CSEQ: 1 INVITECALL-ID: call-F1EF2341-DC33-2C10-040A-10@192.168.100.5MAX-FORWARDS: 70VIA: SIP/2.0/TCP 192.168.100.5;branch=z9hG4bK-tenor-c0a8-6405-0013CONTACT: <sip:4258650709@192.168.100.5;user=phone>CONTENT-LENGTH: 222EXPIRES: 180SUPPORTED: 100relUSER-AGENT: Quintum/1.0.0 SN/0030E1030F8F SW/P107-09-00CONTENT-TYPE: application/sdp…
which the Mediation Server resends to the Front End as:
INVITE sip:2531234567;phone-context=PawlakLab@pawlaklab.local;user=phone SIP/2.0FROM: <sip:4258650709;phone-context=PawlakLab@pawlaklab.local;user=phone>;epid=AE63718344;tag=d8879a6a5fTO: <sip:2531234567;phone-context=PawlakLab@pawlaklab.local;user=phone>CSEQ: 30 INVITECALL-ID: c26f38ff-cd88-4768-9927-9408465c584cMAX-FORWARDS: 70VIA: SIP/2.0/TLS 192.168.100.22:1952;branch=z9hG4bKb0658337CONTACT: <sip:OCSMEDR2.pawlaklab.local@pawlaklab.local;gruu;opaque=srvr:MediationServer:JD2-_D2V8Uas6PL3dHopYwAA;grid=95b7e3cc247a488daac329263114d09f>;isGatewayCONTENT-LENGTH: 2246SUPPORTED: replacesSUPPORTED: ms-safe-transferSUPPORTED: gruu-10SUPPORTED: 100relUSER-AGENT: RTCC/3.5.0.0 MediationServerCONTENT-TYPE: multipart/alternative; boundary=pslWXe0LgTGWJRLgCrFTghFfvoZi3yw7ALLOW: UPDATEms-call-source: non-ms-rtcALLOW: Ack, Cancel, Bye,Invite,Refer--pslWXe0LgTGWJRLgCrFTghFfvoZi3yw7Content-Type: application/sdp…
On the Front End Server, the OCS Translation Service normalized the TO: and FROM: numbers using the PawlakLab Location Profile assigned to my Mediation Server. You can see what’s going on in the Front End Server’s TranslationApplication log shown below:
(TranslationApplication,PhoneProcessor.OnRequest:phoneprocessor.cs(689))( 000000000138C113 )OnRequest: INVITE, reqUri=sip:2531234567;phone-context=PawlakLab@pawlaklab.local;user=phone newHostPart= (TranslationApplication,PhoneProcessor.ProcessFromUri:phoneprocessor.cs(884))( 000000000138C113 )Processing From URI: sip:4258650709;phone-context=PawlakLab@pawlaklab.local;user=phone(TranslationApplication,PhoneNumberTranslator.ApplyProfile:phonenumbertranslator.cs(463))( 0000000001255C0B )ruleName='10-digit' matched Num='4258650709', txNum='+14258650709'(TranslationApplication,PhoneNumberTranslator.TranslateNumber:phonenumbertranslator.cs(250))( 0000000001255C0B )calledNumber='2531234567'(TranslationApplication,PhoneNumberTranslator.ApplyProfile:phonenumbertranslator.cs(463))( 0000000001255C0B )ruleName='10-digit' matched Num='2531234567', txNum='+12531234567'(TranslationApplication,PhoneNumberTranslator.TranslateNumber:phonenumbertranslator.cs(313))( 0000000001255C0B )MATCH: New request Uri='sip:+12531234567@pawlaklab.local;user=phone'
OCS Inbound Routing then looks up the new request URI sip:+12531234567@pawlaklab.local;user=phone against its database and finds that it matches the msRTCSIP-Line URI belonging to amst@pawlaklab.local (Amy Strande), and the Front End proxies the SIP INVITE shown below to Amy’s registered Office Communicator endpoint:
INVITE sip:192.168.100.20:59303;transport=tls;ms-opaque=15cae60641;ms-received-cid=4800 SIP/2.0From: <sip:4258650709;phone-context=PawlakLab@pawlaklab.local;user=phone>;epid=AE63718344;tag=d8879a6a5fTo: <sip:2531234567;phone-context=PawlakLab@pawlaklab.local;user=phone>;epid=3372abab30CSeq: 30 INVITECall-ID: c26f38ff-cd88-4768-9927-9408465c584cRecord-Route: <sip:sip.pawlaklab.local:5061;transport=tls;ms-fe=OCSEER2.pawlaklab.local;opaque=state:F:Ci.R4800:Ieh.GZykctUqoozaKqKMeayNulsF0ERCl9-zRrK6ckbOY25EF3LP8hNgxl3gAA;lr;ms-route-sig=ea5ubDdd4uQJQtNy3PC56xYb8WIZx3LP8hNgxl3gAA>;tag=A47370209F4CDD5C36B2CF909F73768EVia: SIP/2.0/TLS 192.168.100.21:5061;branch=z9hG4bKDFA1B355.21FF2C77E6F903D1;branched=TRUE;ms-internal-info="bbMVpeK6paAjqWzw9vD8u1zD16VDx3LP8hCQFAaQAA"Proxy-Authentication-Info: Kerberos rspauth="602306092A864886F71201020201011100FFFFFFFFD1E43F537E481D10C13EC725DA785F24", srand="7D4A5778", snum="30", opaque="E3EFEBA4", qop="auth", targetname="sip/OCSEER2.pawlaklab.local", realm="SIP Communications Service"Max-Forwards: 69Content-Length: 2246Via: SIP/2.0/TLS 192.168.100.22:1952;branch=z9hG4bKb0658337;ms-received-port=1952;ms-received-cid=9100Contact: <sip:OCSMEDR2.pawlaklab.local@pawlaklab.local;gruu;opaque=srvr:MediationServer:JD2-_D2V8Uas6PL3dHopYwAA;grid=95b7e3cc247a488daac329263114d09f>;isGatewaySupported: replacesSupported: ms-safe-transferSupported: gruu-10Supported: 100relUser-Agent: RTCC/3.5.0.0 MediationServerContent-Type: multipart/alternative; boundary=pslWXe0LgTGWJRLgCrFTghFfvoZi3yw7Allow: UPDATEAllow: Ack, Cancel, Bye,Invite,ReferP-Asserted-Identity: <sip:+14258650709@pawlaklab.local;user=phone>History-Info: <sip:amst@pawlaklab.local>;index=1Message-Body: --pslWXe0LgTGWJRLgCrFTghFfvoZi3yw7Content-Type: application/sdp….
Note that the TO: and FROM: numbers don’t change, but a new field containing the new request URI, P-Asserted-Identity, is added by the Front-End proxy.
Amy’s Office Communicator rings an incoming call, and if the +14258650709 number in the P-Asserted-Identity (or if the 4258650709 in the FROM: tag) matches a number in Communicator’s GALCONTACTS.DB file or in Amy’s Outlook Contacts, then Communicator’s incoming call “toast” notification will display the caller’s name and, if the call is answered, the resolved name will display in Communicator’s call roster.
Note that you can extend this Caller ID capability to resolve Exchange 2007 Missed Call notifications and Voice Mail notifications, as detailed in Jens Trier Rasmussen’s blog article Additional logic for resolving internal calling numbers in Exchange 2007 SP1 Unified Messaging .