Forwarded Calls don’t contain the Called Party’s number

When you setup Lync forwarding or simultaneous ring it always passes the original callers number in the FROM field.

Call Flow

In the example shown above +44 123 4567 calls +44 987 6543 the Lync user has setup a call forward to another number +44 765 4321. When you receive the call on +44 765 4321 you see the original caller id +44 123 4567.

SIP Header wise this is what is sent from the Mediation server to the ITSP:


INVITE sip:07654321@;user=phone SIP/2.0
FROM: <;user=phone>;epid=81E23DEAF8;tag=ab6896ea7e
TO: <sip:07654321@;user=phone>
CALL-ID: b983d9b2-c75a-48e3-a702-ec9b5ef98eb0
VIA: SIP/2.0/TCP;branch=z9hG4bK693cdab6
CONTACT: <;transport=Tcp;maddr=;ms-opaque=ed082191311c6e3b>
USER-AGENT: RTCC/ MediationServer
CONTENT-TYPE: application/sdp

As you can see the FROM is set to the external callers number and the TO is set to the forwarded to number. Although this can be useful to the person receiving the call to see where the call is coming from it does however cause issues for some ITSP’s (Internet Telephony Service Providers)

Introduced in CU2 was a fix to allow a REFFERED-BY header to be added however after applying the patch (or even CU3) the header does not appear. It is alluded to here in the KB article

However it mentions that you need to apply 255421 as well which doesn’t exist (I assume this will be corrected). The actual KB article is 2500421  (

Here is explains you need to update the Mediation server config file.

For those of you that have never had to update the config file it is in the Mediation server directory which by default can be found here:

C:\Program Files\Microsoft Lync Server 2010\Mediation Server\MediationServerSvc.exe.config

For the SIP trace above you would modify the file to:

<?xml version=”1.0″ encoding=”utf-8″?>
                <add key=”” value=”true”/>
    <generatePublisherEvidence enabled=”false”/>

Once you save this file (don’t forget you need to run notepad as administrator to save it) you restart the Mediation Server service.

The headers now appear as


INVITE sip:07654321@;user=phone SIP/2.0
FROM: <;user=phone>;epid=DB23987285;tag=c495f66513
TO: <sip:07654321@;user=phone>
CALL-ID: a2c887ef-a162-4b11-87a5-daf222734f18
VIA: SIP/2.0/TCP;branch=z9hG4bK370cbae
CONTACT: <;transport=Tcp;maddr=;ms-opaque=8c6fc24ca0304215>
REFERRED-BY: <tel:+449876543>
USER-AGENT: RTCC/ MediationServer
CONTENT-TYPE: application/sdp


You can see the FROM and TO headers remain the same but you now have a REFFERED-BY header with the called party’s number. The ITSP can then use this value.


6 Responses to Forwarded Calls don’t contain the Called Party’s number

  1. nickcordrey says:

    Very useful article – please could you confirm that this also inserts REFERRED-BY for a simultaneous ring call?

    • unitycomms says:

      I have just ran the trace and yes I can confirm that you get the REFERRED-BY for simul ring as well

      • nickcordrey says:

        Great thanks for that – this field should solve a few issues in certain call scenarios when interacting with another SIP connected application server… Thanks again for posting this article was exactly what I was looking for.

  2. thetdub says:

    We are fully up to date on all patches and updates on our Lync server, but when we save the changes to our MediationServerSvc.exe.config file and try to restart the Mediaton Server Service, the service fails to start. If we remove the changes to the config file the service starts as it should. Any ideas or suggestions?

    • unitycomms says:

      If the mediation server won’t start after the change it is usually one of two things.
      1) You didn’t enter the data correctly or in the right location. Double check you have all the ” in the right place and terminte the lines correctly.
      2) You used an editor that modifies the format of the file. Do you remove the change by deleting the lines you added or by restoring a copy? I know notepad works if you run it on the server. If you didn’t use notepad and restored a copy then try deleting the lines you added to see if it still fails to start

  3. w1ll1amz says:

    Great post – the MSFT KB article doesn’t tell you where the config file resides so thanks very much for pointing that out. I too had the same issue as thetdub above and it was caused by the quotation marks. I cut and pasted your sample file text above and modified it. I had to change the smart quotes to straight quotes (just delete them are re-type them) and then the service started fine. Thanks again.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: