Trunk Changed Port/Not In Service

Hello,

I have used different port in register string (5060->50600) in my trunk to the provider for routing reasons and despite the fact the trunk is registered, my incoming calls reach my PBX but I get “The number you have dialed is not in service”.

I think it is a configuration issue, something extra I have missed, maybe in general settings or in trunk “PEER Details”/“USER Details”.

I could use a little help.

Thank you in advance.

"PEER Details"
username=XXXXX
type=peer
secret=XXXXXX
qualify=yes
insecure=invite
host=XXXXX
fromuser=XXXXX
fromdomain=XXXXX

"USER Details"
type=user
secret=XXXXX
host=XXXXX
context=from-trunk

"Register String"
XXXXX:XXXXX:XXXXX@XXXXX:50600/XXXXX

XXXXX=username,password,host -> wherever I have used port, it is mentioned

Hi @sequoia can you share with us a calltrace when you try to make a call to your DID ?

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug#ProvidingGreatDebug-AsteriskLogs-PartII

1 Like

Hello @slobera,

Thank you very much for your reply. The article is very useful in general.

From the above screenshot, you may see the behavior of my system, at least in part I hope.

  • The number with the trunk in 5060, gets in the inbound route, gives me DID (in red) and destination and if I use the system unique ID with grep I have some results.

  • The number with the trunk in 50600, never gets in the inbound route, no DID, destination “s [from-sip-external]”, answered because of the “not in service” message and grep with the [1589712619.2] system ID gives nothing at all in terminal.

The above is the result on the GUI, when I click on the system ID.

Please feel free to ask for any info.

Thank you again.

Try adding
port=50600
to both the peer and user details for the trunk that is registering to port 50600.

1 Like

Hello @Stewart1,

Thank you for your answer.

I have tried your recommendation with both peer and user, only user and only peer, and nothing made the call to get in the PBX.

Thank you again.

freePBX-debug3

To contribute more to the subject, the above screenshot is mentioning the ports from the packet I send and the ports from the returned packet (Reply Src/Dst Address).

At the Asterisk command prompt, type
sip set debug on
make a (failing) test call into your PBX, paste the relevant section of the Asterisk log at https://pastebin.freepbx.org and post the link here.

Also, a Google search for
"ims.otenet.gr" "50600"
yielded no results. I assume that OTEnet allows registration to port 50600 to work around routing problems at the client end. Did you get any documentation that explains how to do that? Also, explain why you need that in the first place e.g. “I’m behind a pfSense firewall that is administered by someone else”. Did you try a pjsip trunk? If so, what problems did it have?

Hello @Stewart1,

Please let me elaborate a little further because I can now understand that I missed critical info.

PBX -> Router 1 -> Router 2 -> SP

I need to route my SIP registration to my provider through a certain site (Router 2), so that is why I have tried to catch the traffic with different port in SIP register string.

The outcome is that Router 1 catches the packet and route it to Router 2, where Router 2 changes the port to 5060 before it sends it to SP (you can see the below screenshot).

freePBX-debug4

So my SP validates my registration, because for them the ports are the appropriate.

I guess that the conflict is my PBX gets traffic in 5060, because my SP sends there my incoming calls and my PBX is configured in 50600. I thought that ports are used only for the packet routing so based on my NATing all would be forwarded properly, but from this experience it seems that the packet data section maybe has values based on ports (please correct if I got this wrong).

As business analyses, the request is to find a way to capture the packet so I can route it, so if anyone knows a value I could use from my PBX instead of port and capture it with my router (MikroTik rOS), that will do.

Maybe this is more of a routing subject but I am willing to understand if there is a way to distinguish SIP registration to the same SP from the same interface, not only based on authentication credentials.

I hope this message make things more clear than confusing.

As for the debug log, I have captured a section from the console but I do not know if this helps.

https://pastebin.freepbx.org/view/f2099179

Thank you all for your time spending on this.

Hello,

I have found that I may create a second interface with different IP/VLAN.

Is it possible to route trunks in any interface I want?

Maybe this would make things more clear in my setup.

Thank you in advance.

There’s an underlying networking question that you need to have a good picture of before you’re going to get this working. It involves how traffic is routed around your network, which implies that no one but you and your network provider are going to be able to help.

So, in your diagram, you have your PBX, a local router, and then a gateway router that connects to your ITSP. Simple enough, but not.

For the traffic from your PBX to get to port 5060 at the ITSP, your PBX needs to know that address and send the traffic to that port. When it does, it uses the NAT configuration settings to prepare a “return path” through the network. This means that the traffic coming back has to have a clear path from a routable address to your PBX. The trickiest part of this setup is that there are only two addresses that the SIP traffic knows about when using NAT - the “local” address of the PBX and the routable “external” address. For your network to work “as is”, you’ve got a lot of routing to do to get the traffic where it needs to go.

There are lots of ways to do this, but few of them are fool-proof.

Let’s suppose your PBX is set up using 192.168.0.1 on the local LAN. That’s the address that it will tell remote machines to send the traffic to. If they are on the LAN, that’s good. If not, they have to know how to get to that address. That’s what the NAT settings are for. The problem you are going to run into is that, normally, the ‘external’ address is where the traffic is directed. That remote router must know how to get your traffic to you.

This is usually done with a “redirect” which tells the external router to send all traffic on a specific port (say, 5060) to the internal machines. In your situation, each LAN will have to be set up to properly forward the traffic. Because of that, it isn’t a simple matter of “setting the NAT” correctly, you also have to make sure that every intervening device knows how to get traffic from point “A” to point “D” (in your case).

Hello @cynjut,

Thank you very much for your reply and bothering to comprehend my setup and issue.

The truth is that I think that the routing has the proper setup because I can get my account registered. The thing I surely do not know is if the problem of my declined service lies on using the port 50600 in my register string.

For now I have just set a new freePBX so I would have a different LAN IP address to use and forward my traffic as I need.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.