Issues with trunk remote

Hello everyone, I’m nob, and I’m attempting to configure a TG200 (GSM gateway) located remotely via L2TP VPN with MikroTik routers without NAT. I’m facing issues in making outbound calls. While I’ve managed to enable incoming calls by adjusting the parameter to allow anonymous calls in the PJSIP configuration, I’m still struggling with outbound calls. I’ve attached the logs from both the PBX and the GSM gateway. Any assistance would be greatly appreciated. Thank you

gateway gsm(

Logs gateway gsm:

I’ve added the gateway gsm logs.

You are calling a number that either the gateway or the mobile network does not recognize. or at least that is the proper meaning of 404.

Thank you for your response, but it’s not logging the gateway the dialed number. What could be happening? What tests can I perform?

The gateway has been told to dial 09xxxxxxxx but says that isn’t a valid number. If this is the number you meant to dial, this is a problem with the gateway. If it is not the number you atttempted to dial you may have a misconfigured outbound route, but there isn’t enough information about what you dialled, or how the route is configured, to be more precise.

No calls are being logged on the gateway. Does this mean that the PBX’s message is not being interpreted? Hence, it’s returning the 404 error.

I don’t have any calling patterns configured.
IP to mobile = Simple Mode


404 means the request URI is not recognized, typically because the user part is not valid. The user part is normally interpreted as the number to dial, so it is saying that 09xxxxxxxx is not a valid number to call.

Really though, if 09xxxxxxxx is the number you intended to call, this is a gateway issue, not a FreePBX one.

The number is not the actual one; I changed it for privacy reasons. The one actually dialed is correct, yet it responds with a 404 error. It seems to be related to the gateway, a Yeastar TG 200 V3. I recently updated it to the latest firmware version. It might be expecting a different type of message or could be missing something, hence the 404 response. Perhaps a different configuration is needed.

I’m also experiencing an issue where incoming calls are being rejected.

I forgot to mention that the trunk I’m attempting to configure is located in a different country than the PBX. The dial tone might be a factor causing issues with outgoing calls?.thanks

In the pbx logs I also see the 404 error.

This one is harmless.

What test do you recommend I do to find the correct uri?

I turned on the normal logs from gateway gsm and found this error.

Read the documentation for the gateway. You are trying to find problems in Asterisk when all the evidence points to Asterisk doing what you are telling it to do.

What is ‘chan_vsgsm’ ?

These are GSM gateway Normal logs

But chan_vsgm.c is not a native channel driver included in Asterisk source, how was it compiled and by whom ?