locked
504 Cannot connect to the gateway RRS feed

  • Question

  • Hi all, I am facing following issue:

    Lync connect to MEdiant 1000 from one side; the side of Mediant there is a Legacy PBX connect by QSIG

    . I i call a legacy user that is fwd to someone else, i always get this error at Lync side.

    Does anyone has idea?

    NOTE: I am using TCP and NOT TLS beetwen Lync and Mediant 1000.

    TL_INFO(TF_PROTOCOL) [1]14E4.19CC::03/07/2013-14:24:19.314.0007f2d5 (S4,SipMessage.DataLoggingHelper:1823.idx(774))[1526370295] <<<<<<<<<<<<Incoming SipMessage c=[<SipTcpConnection_225D98A>], 10.9.10.84:63993<-10.9.6.200:5060 SIP/2.0 302 Moved Temporarily FROM: "User AAA" <sip:0522375542@domain.com;user=phone>;tag=877fb87b1f;epid=A00FAF86FD TO: <sip:2542@mediagwrelw.domain.locale;user=phone>;tag=1c1323115070 CSEQ: 49416 INVITE CALL-ID: 37d7c4bc-10f6-4c1a-86de-db3281f35b54 VIA: SIP/2.0/TCP 10.9.10.84:63993;branch=z9hG4bK98bcf9f0 CONTACT: <sip:+390522375541@10.9.10.84;transport=tcp;user=phone> CONTENT-LENGTH: 0 SUPPORTED: em,timer,replaces,path,resource-priority ALLOW: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE SERVER: Mediant 1000 - MSBG/v.6.60A.027.014 Diversion: <tel:2542>;reason=unconditional;counter=1 Reason: SIP ;cause=302 ;text="302 Moved Temporarily

    TL_INFO(TF_PROTOCOL) [3]14E4.19C8::03/07/2013-14:24:21.402.0007f5ed (S4,SipMessage.DataLoggingHelper:1823.idx(774))[178078025] >>>>>>>>>>>>Outgoing SipMessage c=[<SipTlsConnection_26399D0>], 10.9.10.84:5070->10.9.10.84:63701 SIP/2.0 504 Cannot connect to gateway. Error: No target available to redirect or all redirect targets have been tried. FROM: "User AAA"<sip:user.aaa@domain.com>;tag=3e0f3f1903;epid=af298e8687 TO: <sip:2542;phone-context=site_emilia@domain.com;user=phone>;tag=d43d3728e;epid=ED08F28805 CSEQ: 1 INVITE CALL-ID: 2061c3c092d7415a87ec128d51c8543c VIA: SIP/2.0/TLS 10.9.10.84:63701;branch=z9hG4bKB80C43D8.B0A7A8D5C272D5B2;branched=TRUE,SIP/2.0/TLS 172.16.52.148:54877;ms-received-port=54877;ms-received-cid=104A00 CONTENT-LENGTH: 0 P-ASSERTED-IDENTITY: <sip:2542@domain.com;user=phone> SERVER: RTCC/5.0.0.0 MediationServer ms-diagnostics: 10504;source="SRV84.domain.locale";reason="Gateway responded with 504 Server Time out";component="MediationServer";SipResponseCode="504";SipResponseText="Cannot connect to gateway. Error: No target available to redirect or all redirect targets have been tried.";GatewayFqdn="mediagwrelw.domain.locale;trunk=mediagwrelw.domain.locale" ms-diagnostics-public: 10504;reason="Gateway responded with 504 Server Time out";component="MediationServer";SipResponseCode="504";SipResponseText="Cannot connect to gateway. Error: No target available to redirect or all redirect targets have been tried." ms-trunking-peer: mediagwrelw.domain.locale;trunk=mediagwrelw.domain.locale ms-endpoint-location-data: NetworkScope;ms-media-location-type=intranet



    Thursday, March 7, 2013 2:46 PM

All replies

  •  First Thing is, you should always use E.164 number Format in you Lync enviroment to make Calls.

    Please check your Gateway configuration to use the right SIP ports. If you use TCP it should be 5068 on both sides.

    Lync Mediation Server use 5068 as Default TCP port and 5067 for TLS.


    regards Holger Technical Specialist UC

    Thursday, March 7, 2013 4:39 PM
  • Please check the Listening port for IP/PSTN Gateway, By default, the ports are 5066 for TCP and 5067 for TLS on a PSTN gateway in topology builder. Make sure that port is opened on your gateway.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Sunday, March 10, 2013 7:26 AM
  • Hi all and thanks for replies. 

    From which part of SIP codes you understood there is a Port problem? IP/PSTN gw, at lync side, is programmed to send calls to SIP port 5060. At audiocodes side, calls are sent to lync port 5068. 

    Can you point me where in the sip trace there is a problem?

    Thank you very much

    Monday, March 11, 2013 10:16 AM
  • The problem is probably the following:

    CONTACT: <sip:+390522375541@10.9.10.84;transport=tcp;user=phone>

    Lync is checking the contact header where the phone number is not relevant but the @10.9.10.84 is relavant.
    Lync can probably not resolve this IP address most likely because the certificate CN field is FQDN.

    Have seen this before that everything is going fine except the forwarded calls creating 302-Moved messages , check this and if this is the case change it to FQDN.


    • Edited by Lucrezia30 Tuesday, March 12, 2013 9:37 AM
    • Proposed as answer by Lisa.zheng Tuesday, March 26, 2013 3:27 AM
    Tuesday, March 12, 2013 9:36 AM
  • Hi, 10.9.10.84 is the FE!!! I suppose Lync knows it ;-)

    I will try with FQDN

    Tuesday, March 26, 2013 7:40 AM
  • Does not matter if Lync knows it this has to do with the network...... :/
    Tuesday, March 26, 2013 10:43 AM
  • Did you ever get a resolution to this or a format that worked for you as I am trying to do a similar call forward that is not working.
    Tuesday, November 29, 2016 11:43 PM
  • Hi Antonio,

    How do you have configured the IP profile for Lync if the FQDN, Port and IP is correct?

    Have you used the original documentation from Audiocodes to connect with Lync?  


    regards Holger Technical Specialist UC

    Wednesday, November 30, 2016 7:12 AM