How to Connect UCM to TG Gateway

1. Introduction
This guide explains how to connect Grandstream UCM to Yeastar TG VoIP gateway via service Provider SIP Trunk (Peer-to-Peer).
This guide has been tested with:
Yeastar TG400 version
UCM6102 version

After connectingTG400 and UCM6102, GSM/UMTS/CDMA trunk will be extended on UCM6102.
The following features can be achieved:
1. Make outbound calls from UCM via the GSM/UMTS/CDMA trunks of TG400
2. Receive calls from GSM/UMTS/CDMA trunks of TG400 at UCM.

IP address of UCM6102:
IP address of TG400:

2. Connect UCM6102 to TG400
Step 1. Create a SIP Trunk on UCM6102
Path: PBX<TrunksVoIP <TrunkService Provider
Type: peer SIP trunk
Provider Name: TG400
Hostname/IP: fill in TG's IP address,

Save and apply the changes, we can check the status of this trunk
Path:StatusPBX StatusTrunks

Step 2. Create a Service Provider SIP trunk on TG400
Path: Gateway→VoIP Settings→VoIP Trunk

Trunk Type: Service Provider
Type: SIP
Provider Name: give a name for the trunk.
Hostname/IP: fill in UCM IP address,, the default port is 5060.

Save and apply the changes, we can check the status of this trunk, it should be OK.
Path: StatusSystem<StatusTrunk<Status


3. IP to Mobile
In this section, we introduce how to achieve making outbound calls from UCM6102 through GSM/UMTS/CDMA on TG400.
Step 1. Create one outbound route on UCM6102.
Path: PBX→Basic/Call Routes→Outbound routes→Create New Outbound Rules
Choose the SIP trunk “TG” which is connecting to Yeastar TG400. Set the dial rule, here we set Pattern as “_9.” and Strip 1 digit, meaning that you have to dial digit 9 before the destination number.

Step 2. Configure one “IP ->Mobile” Route on TG400.
Path: Gateway→Routes Settings→”IP->Mobile” Suppose that you want to use GSM trunk 1 to call out.

Route Name: give a name for the route, “UCM”.
Call Source: choose the VoIP trunk which is connected to UCM, “SPS—CUM”.
Call Destination: choose “Mobile—GSM1”.

Step 2. Test a call from UCM6102
Now, you can make external calls from UCM6102 through the trunk GSM1 on TG400. As the dial rule set on UCM outbound route, you need to dial 9 before the number. For example, if you want to call number 15880123456, you need dial 915880123456 on your phone.

4.Mobile to IP
In this section, Introduce how to route incoming calls from GSM trunks to UCM6102.
Step 1. Create an inbound route on UCM.
Path: PBX→Basic/Call Routes→Inbound routes→Create New Inbound Rules
Here we configure the inbound route as below:
DID Number: 123456
Destination: Extension 1000
The incoming calls with DID number 123456 would be routed to extension 1000.


Step 2. Configure one “Mobile ->IP” Route on TG.
Path: Gateway→Routes Settings→”Mobile->IP”

Route Name: give a name for the route, “UCM”
Call Source: choose the GSM1
Call Destination: choose the VoIP trunk which is connected to UCM, “SPS—UCM”.
Hotline: set Hotline to 123456, which is the same number with the DID number set on UCM Inbound route.

Step 3. Test a call.
Dial the trunk GSM1’s number(1625351623) on your mobile phone, the call will be routed to UCM extension1000.

[The End]

Have more questions? Submit a request


  • 0

    I think we should strip one digit in UCM outbound routes.

  • 0

    hi i was followed the configurations above,my inbound or incoming is fine. but the outbound call is not working, when i dialed 8 which 8 digits here in Qatar i use 8 as pattern. but only busy tone and displaying FAILED. Please help me to resolve this problem... thanks!

  • 0

    AI, do you need to send out the first digit 8? If yes, please setup on the outbound rule page, strip 0 digit or leave the strip filed blank then try again.

  • 0

    Hi this is the screen shot of my configuration, please check if is correct, 

  • -1


    thank you for the brilliant walk through..i have the TG200v2

    it worked perfectly but i am able to call from only 1 sim..i receive calls on both sim but can only call 1 sim 

    please advise

  • 0
    Permanently deleted user

    Tarek, you can use the mobile group for a check or you  can create another one mobile to ip route and then set up the related DID Numbers.


  • 0

    thank you 

    is working good with me i have TG200 , and i caret mobail group . but i cant do GSM1 for some extension and GSM2 for other extension  

    dial 9 For GSM1

    dial 8 For GSM2



    please advise 

  • 0

    hello guys

    i have a ucm6204 with TG1600, i want to connect them together, i was going on top steps, but it shows me status failed, how can i connect them together.

    kindly help me to connect them together.

  • 0

    You have to make SIP Peer Trunk on both sides. When trunk is reachable from both sides then you have to create outbound and inbound routes for calling. 

  • 0

    dear Ayush


    I did that and still is unreachable? what is wrong?

  • 0

    In UCM go to maintenance- network troubleshooting- ip ping - enter TG IP and check whether you can ping or not. 


    If IP is not pinging that is why it is showing unreachable. Some network issue is there. 


  • 0

    Sometimes UDP port is also different that is why issue comes. You can check in PBX Setting- SIP setting - UDP port .

    You also need to check in TG for port number. 

  • 0

    dear Ayush


    thank you very much for your reply again, that is very kind of you i appreciate your swift response

    i did that, also i checked the UDP port, but still is unreachable

  • 0

    You have to check your network. 


  • 0
    Good afternoon colleagues.
    I am new to the world of telephony, telephone exchanges and gsm gateway.
    The physical connection of the devices is between devices? Or I connect my 2 devices to my lan network.
  • 0

    Hi Javier,

    Your question seems not related to this topic. 

    Well, what Yeastar device do you have now? And do you want to interconnect the GSM gateway with telephone exchange. 

  • 0

    Good day 

    i need help with the inbound call from GSM number to extension 

    i set the DID to 123456 ( please is this a default setting or the DID has to be the GSM number on the gateway) after which when i call the number on the gateway i would ring once and drop. how can i resolve this thanks.

Please sign in to leave a comment.