Unable to Forward Calls to External Numbers


#21

As described in an earlier post, please turn on sip debug, make a failing forwarded call, paste the Asterisk log for the call at pastebin.freepbx.org and post the link here.


(Ruler2112) #22

I have that debug, but am hesitant to post it publicly because it has our IP, provider’s IP, and the phone numbers of a bunch of people in it, including the cell numbers of both myself & one of the sales people. Is there something in place that prevents this information from being harvested by unscrupulous individuals?


#23

No, but it’s just a text file; redact it as desired. For example, replace your WAN IP with wwww, provider’s IP with pppp, original caller’s number with oooo, forwarded-to number with ffff, etc. Make it clear what each substitution represents.

BTW, unless you have a non-disclosure agreement with your provider that prohibits you from telling others you are using them, don’t redact that – it’s useful information for debugging.


(Ruler2112) #24

I did exactly as you suggested & did a search/replace on the various items in the log. I made it obvious, like replaced the middle 2 octets of the IP addresses as SIP.IP for our provider & OUR.IP for our own. Likewise with the phone numbers involved. Honestly, I’ve no idea if we have an NDA for not - as McCoy might say, “I’m a tech guy, not a doctor!” :wink: :smiley: - so changed their name to ‘telco’ just in case.

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


(Ruler2112) #25

BTW, I used tcpdump to grab a capture from another session & while wireshark says the RDP stream lasting 14 & 13 seconds in the VOIP Calls tool, there are 0 packets from any of the port numbers listed in the SIP debug dump (52880, 19350, 51308, 18294). When I use the RDP stream tool to play the streams, they show as being empty. :confounded:


#26

Unfortunately, you pasted the console output rather than the Asterisk log, so there are no timestamps and we can’t see what Asterisk was doing. If you paste another log, please use the appropriate section of /var/log/asterisk/full

I didn’t see anything obviously wrong with the SDP (and suspect a Meraki config issue), but did notice on line 73 that Asterisk sent 180 Ringing before initiating the outbound leg. I assume that is because you were using Follow Me or a Ring Group rather than straight forwarding (good).

As a test, temporarily change Play Music On Hold for the Follow Me or Ring Group from Ring to default. Make another test call. What does the caller hear while the outbound leg is ringing (music, ringing or silence)? After the outbound leg is answered, can the caller hear the forwarded-to party? Can the forwarded-to party hear the caller?

Based on your answers we’ll suggest the next test or capture.


(Ruler2112) #27

I’m digging out the full log from the call I posted the console log of yesterday. Sorry about misunderstanding what you wanted.

The line is actually set to forward using Lorne’s pay-it-forward php script, not find me/follow me. (I’ve tried FMFM & the results are the same with the exception of the caller is able to hear the PBX voice mail greeting if the cell phone is not answered.) Got an extra IP phone on my bench and will experiment with what you suggest, then report back it’s behavior.


(Ruler2112) #28

Here’s the redacted chunk of the full log from yesterday that deals with this particular test call. (Amazingly, there were no other calls in or out during this these few minutes, so it should be relatively clean. :slight_smile: )

https://pastebin.freepbx.org/view/5df66b9f


#29

Unless I missed something, it still looks like incoming audio is blocked until outbound audio is sent.

So, please try the Follow Me setup with Music On Hold set to default (and paste a log if it fails).


(Ruler2112) #30

That worked @Stewart1! When I called the forwarded extension, I got our hold music & then the salesman answered his cell phone. I could hear him & he could hear me, just like a regular call.

While this certainly allows for a viable workaround, ideally the users would be able to use the call forward all button on their phones to forward calls to their cell phones. I’m sure you had me try that based on past experience… what does this imply about what’s going on behind the scenes?


Also, I received a complaint earlier today from one of the office girls. She said that for the past several days, the call history on her s405 shows every call as having been made to our main number until you go into the call details - then it shows the real number dialed. My hunch is that this is caused by my adding fromuser=<989MAIN#11> and sendrpid=pai to the trunk configuration and the phone is looking at the from user for the initial display. Am I heading in the right direction? Any way that you know of to correct it without breaking something else?


#31

Most likely, the first issue is port forwarding on the Meraki. Assuming that your model is similar, you should have an entry like


Description: Asterisk RTP
Uplink: (your internet interface)
Protocol: UDP
Public port: 10000-20000
LAN IP: (LAN address of the PBX)
Local port: 10000-20000
Allowed Remote IPs: Any

This is unrelated to trunk configuration. I know little about these phones so the below are guesses:
For the extension, try setting Send Connected Line to No, or Send RPID to No.


(Ruler2112) #32

You’re awesome @Stewart1! Thank you so much for all of your help; using your workaround, all the lines are now forwarding to the people’s cell phones successfully. I’ll probably end up recording the sound of a ringing phone & uploading it as music on hold to make it more transparent from the caller’s perspective, but it’s a simple and effective workaround. :slight_smile: :smiley: It requires intervention on my part to set / unset the forwarding, but my users are overall pretty happy that it’s working.

As far as the firewall, I do have a concern about opening up the PBX to the outside world. There’s a rather esoteric flaw in the firewall of PBXact version 13, which we are stuck on if we want to keep the high availability feature we were sold. As a result of this bug, the network interface needs to be in Local / Trusted mode or else the Cisco phones running SIP will not connect to the PBX when they are reset. I opened a ticket with Sangoma about this a couple months after getting the system. We did packet captures with just the IP range of the phones trusted, firewall disabled, different interface settings, etc - after a couple of weeks of troubleshooting, they admitted there’s a bug in the firewall, but weren’t going to fix the defect because version 13 was already ‘being sunsetted’. :worried: :angry:

Because of this, I have to rely entirely on the edge firewall to protect the PBX. If I forward ports through the Meraki firewall, they have the potential to be exploited by anyone on the internet as the PBX can’t protect itself without killing connectivity to the majority of our phones if they reboot for any reason. If I were to set the allowed remote IPs to that of our provider’s SIP server so that ONLY traffic from it would be forwarded through, do you think this would be adequate eliminate the issue? (Not certain if the RTP stream would come from our provider’s SIP server or the device calling in.)


For anyone monitoring this thread who might be interested, the response from Meraki about SIP being ‘stuck’ going out an interface despite there being flow preferences to the contrary was to reboot it and hope it doesn’t happen again. :roll_eyes: :disappointed: (Yeah, I paraphrased that second part, but that’s basically what it boils down to. :frowning_face: )


#33

This is a quite complex issue and I don’t know all the answers. On my own systems, UDP ports 10000-20000 are open to the world and I don’t worry about it, because Asterisk uses those ports for RTP only.

If my system got compromised by another means, it’s conceivable that the attacker would plant a back door listening on one of those ports. That is also not a concern; if I discovered the break-in the system would be re-installed from scratch anyway, and if not there are ways to implement back doors that don’t require open ports.

However, because you seem to be running Asterisk 13.23.1, it is likely vulnerable to RTP Bleed; see
https://www.rtpbleed.com/
https://packetstormsecurity.com/files/143976/Asterisk-14.6.1-RTP-Bleed.html

So, is it safe to forward the RTP port range from only the provider IP address(es)? I believe so, but you’ll have to confirm with them (many providers don’t proxy media but send directly to/from the upstream carrier). Also, it’s possible that when you do the limited forward on the Meraki, those ports become unavailable from other addresses, even as replies. You’ll have to test that. Finally, you might confirm with the provider that if they need to assign a new IP address to your server (or assign a different server), you will have sufficient notice to update the Meraki.


(Ruler2112) #34

Interesting (and frightening!) reading in those links.

We put the system into place in late 2019, which is well after the 2017 date of the asterisk patches addressing this in the second link, so I’m unsure if we’re affected or not. It is alarming though that the same link says that SIP Vicious can exploit it… I’ve seen several packets labeled sipvicious in the dumps (analyzed through wireshark) from the network tap I have in place at our modem in the week I’ve been doing packet captures. That of course is outside of our Meraki - going to run an extended packet capture from the PBX console & see if these packets are being allowed through or if it’s just random scanning from script-kiddies.

Does anyone here know if Asterisk 13.23.1 on PBXact 10.13.66-22 is vulnerable to the RTP Bleed flaw? Or know how I would go about testing my own system to determine this for certain?


#35

Sorry, my bad. The fix was backported to 13 in 13.17.1. See
http://downloads.asterisk.org/pub/security/AST-2017-005.html
so forwarding those ports should be safe (as far as is now known).


#36

sipvicious pretty well only only stalks “Sessions Initiated” to UDP/5060 less often 5160, you can choose not to listen there.


(system) closed #37

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