Can't get direct SIP to work

Status
Not open for further replies.

MucCX

Free User
Joined
Dec 30, 2020
Messages
35
Reaction score
4
Hi,

I have a working installation of 3cx on my own server. It is connected to my telephone company via VOIP and I have extensions set up that can be reached by calling my phone number and they can also make outbound calls. So everything is working as it should be.

Now I am trying to add direct SIP calls. I have activated the option under Settings and I have given one extension a SIP name. But when I call that extension by either [extension]@[my3cxFQDN] or [sipname]@[my3cxFQDN] nothing happens.

I can call [sipname]@[myIPaddress] and it will ring but only for a few seconds. If I manage to accept the call quickly enough I don't hear anything (and neither does the other end) and after about 30 seconds the call terminates. If I call [extension]@[myIPaddress], nothing happens but maybe the system only accepts sipnames and no extensions for direct SIP calls?

Has anybody been able to get this to work and can share their experience?

Thanks!
 
Hi @MucCX

Are you using a 3CX FQDN or a custom one? Also does your FQDN resolve to the correct IP Address? When using direct SIP Calls you should always call the SIP ID name and not the extension number.
Also check your activity log for any errors. You will get better results if you enable verbose logging.
 
Hi YiannisH_3CX,

Actually, I have both a 3CX FQDN, which I guess does resolve to the correct IP, and a custom one, which I know does resolve to the correct IP. And I have tried both using my 3CX FQDN and my custom FQDN in the networks settings. Neither does work.

I understand that not being able to receive a call under [extension]@[myIPaddress] is not a bug. So I will not further investigate.

I'd like to start troubleshooting the self-terminating calls and the no-hear issue. So I briefly enabled verbose logging, called [sipname]@[myIPaddress] directly and accepted the call. Actually, before the call terminated again, on the internal extension, I could hear what the caller (me) said but as the caller, I could not hear what the callee (me) said. After 36 seconds, the call terminated again. It will take me a while to sift through the call logs. "Verbose" is an understatement... Is there anything in particular you can recommend for me to look for?
 
Actually, I have both a 3CX FQDN, which I guess does resolve to the correct IP, and a custom one, which I know does resolve to the correct IP. And I have tried both using my 3CX FQDN and my custom FQDN in the networks settings. Neither does work.
Are these on the same PBX? Is the custom just to resolve to the internal IP? How is that configured?

You can filter the activity log by selecting the last call and it will just show details of only that call. See if there is an error message or the reason the call is dropping.
 
Unfortunately, I was wrong.

My normal VOIP phone calls also do not work: Also here only the caller hears the the callee but the callee does not here the caller. So the problem I described above does not appear to be direct sip specific.

I have no idea where to look for a solution now. The firewall checker says everything is fine (I don't have forwarded all ports between 9000 and 11000 but only 32 port from 9100 (but that should be enough for 16 simultaneous calls, right?).

Both FQDNs resolve to the same machine. But only the 3CX FQDN is configured in the 3CX installation (unless I mention it for direct sip purposes in the network settings) and so, I am guessing, 3CX is also only aware of the 3CX FQDN. I cannot imagine that another FQDN also resolving to me 3CX machine could cause any trouble.
 
I have no idea where to look for a solution now. The firewall checker says everything is fine (I don't have forwarded all ports between 9000 and 11000 but only 32 port from 9100 (but that should be enough for 16 simultaneous calls, right?).
You need to forward all rtp ports. 16 sim calls does not mean that the PBX will use only the first 32 ports. The PBX will move up the ports until it reaches the end of the list.
Make sure all RTP ports are forwarded then run the firewall checker again to make sure that everything passes and try again.

Both FQDNs resolve to the same machine. But only the 3CX FQDN is configured in the 3CX installation (unless I mention it for direct sip purposes in the network settings) and so, I am guessing, 3CX is also only aware of the 3CX FQDN. I cannot imagine that another FQDN also resolving to me 3CX machine could cause any trouble.
That should not cause any issues.
 
You need to forward all rtp ports. 16 sim calls does not mean that the PBX will use only the first 32 ports. The PBX will move up the ports until it reaches the end of the list.
Make sure all RTP ports are forwarded then run the firewall checker again to make sure that everything passes and try again.


That should not cause any issues.
Update:
It was the firewall.
The no-hear issue for normal VOIP calls is resolved. Normal VOIP calls now really work as they should.

(This was prior to your above response, so I have not forwarded all RTP ports yet but I will look into it. So far, I refrained from doing this because of a collision with other servers in that port range.

But are you saying that 3CX will not function properly, if it doesn't have all 2000 ports at its disposal, even if it only needs 32 (in my case with 16 calls max) at a time? When you say "The PBX will move up the ports until it reaches the end of the list -- does that not mean that 3CX will try to find a suitable port from its list and, if 32 ports from that list are open, will find and use them?)

So back to Direct SIP.

When I now call [sipname]@[my3cxFQDN] or [sipname]@[myIPaddress] from Zoiper and from outside my network, the call seemingly is accepted (Zoiper starts counting the time) but internally, it is not signaled. No extension actually rings. And after about 30 seconds, Zoiper reports that the call was rejected (request timeout (code 408)).

In my 3cx activity log I can't find any mention of the call. Sounds like a firewall issue, right? But in the firewall log, I can't find it being blocked. It is my understanding that the call should be signaled on port 5060 (and/or 5061), is that right? These ports are definitely open (as evidenced by the ability to receive calls from my VOIP provider). Maybe it is a problem with Zoiper. (I may need to find another app that allow me to make Direct SIP calls.)

Or do you think that not having all RTP ports open and forwarded to 3CX could be responsible for this? The way I understand it -- but I may be wrong, of course -- is that the RTP ports only come into play, once a call is established.
 
But are you saying that 3CX will not function properly, if it doesn't have all 2000 ports at its disposal, even if it only needs 32 (in my case with 16 calls max) at a time? When you say "The PBX will move up the ports until it reaches the end of the list -- does that not mean that 3CX will try to find a suitable port from its list and, if 32 ports from that list are open, will find and use them?)
The PBX has a set of ports it knows it can use. You can find them here. The PBX is not aware you only opened 32 ports on your firewall so it will try to us the full range of those ports. If the firewall is blocking them then you will have one way audio. The PBX will use the first pair of ports then it will move to the second pair, third pair etc. It will only recycle ports if it reaches the end of the list or if the SIP Server service is restarted.
In short you need to open all ports to have it working properly.

In my 3cx activity log I can't find any mention of the call. Sounds like a firewall issue, right? But in the firewall log, I can't find it being blocked. It is my understanding that the call should be signaled on port 5060 (and/or 5061), is that right? These ports are definitely open (as evidenced by the ability to receive calls from my VOIP provider). Maybe it is a problem with Zoiper. (I may need to find another app that allow me to make Direct SIP calls.)
Since there is no log in 3CX then the call is not reaching the PBX. Your firewall does not have a record blocking it but do you see it passing through? You could run a packet capture and check if the call is hitting the firewall.

Or do you think that not having all RTP ports open and forwarded to 3CX could be responsible for this? The way I understand it -- but I may be wrong, of course -- is that the RTP ports only come into play, once a call is established.
Even without the RTP ports open the call should still hit the PBX. RTP ports are only used for audio so the call should still establish even without those. Invites will arrive at port 5060
 
Status
Not open for further replies.