Author
Topic: Setting up VoIP.... (Read 3625 times)

I started playing with VoIP a month or so ago after I signed up for my broadband provider's VoIP. I understand from previous comments (I think Zaerc or Thom) that SIP can be a little challenging to setup when you are routing over NATs - assuming this is because of the UDP component.

Anyway, I haven't done much so far except get a WiFi SIP phone connected to Asterisk (very nice) and making calls etc between the onscreen Orbiter and the phone. I setup a SIP trunk to my provider and had to guess the parameters a little bit because the terminology doesn't always match. And set up a route and connected one to the other. In the dial plan I am just using 9 for an external line and passing all the other numbers as is, so "9|."

My core connects directly to my broadband router's LAN port, the broadband router is running as a router (ie not bridging or using PPPoE, which I am not interested in) - I set the router up with a "Virtual Server" (basically a NAT) for the SIP port and disabled the SIP functionality on the router (otherwise it intercepts the traffic and doesn't let you set up the NAT!). The NAT points to the core's external interface. And I configure the core's firewall to allow that traffic.

Essentially, I cannot place calls. Whilst tinkering I got various errors depending how I called. Sometimes I just came back with an announcement that the number doesn't work as dialed, or a message saying there was network congestion, etc.

So I called my provider, 1) to check if they had any experience setting up Asterisk on the parameters for their network (not really, except that they said it had been hard in the past!), and 2) to ask them to check their logs to see if my traffic is even getting to them.

Interestingly, their logs indicated they could see me placing lots of calls and could even tell me the numbers I was attempting to call. BUT, he said that the logs suggested that they were successful... they clearly were not, so I'm not sure how to interpret that!

Can anyone out there make any suggestions on the NAT'ing and other configuration that might help - I'm assuming that it is just a problem with the NAT side of things...

I started playing with VoIP a month or so ago after I signed up for my broadband provider's VoIP. I understand from previous comments (I think Zaerc or Thom) that SIP can be a little challenging to setup when you are routing over NATs - assuming this is because of the UDP component.

Anyway, I haven't done much so far except get a WiFi SIP phone connected to Asterisk (very nice) and making calls etc between the onscreen Orbiter and the phone. I setup a SIP trunk to my provider and had to guess the parameters a little bit because the terminology doesn't always match. And set up a route and connected one to the other. In the dial plan I am just using 9 for an external line and passing all the other numbers as is, so "9|."

My core connects directly to my broadband router's LAN port, the broadband router is running as a router (ie not bridging or using PPPoE, which I am not interested in) - I set the router up with a "Virtual Server" (basically a NAT) for the SIP port and disabled the SIP functionality on the router (otherwise it intercepts the traffic and doesn't let you set up the NAT!). The NAT points to the core's external interface. And I configure the core's firewall to allow that traffic.

Essentially, I cannot place calls. Whilst tinkering I got various errors depending how I called. Sometimes I just came back with an announcement that the number doesn't work as dialed, or a message saying there was network congestion, etc.

So I called my provider, 1) to check if they had any experience setting up Asterisk on the parameters for their network (not really, except that they said it had been hard in the past!), and 2) to ask them to check their logs to see if my traffic is even getting to them.

Interestingly, their logs indicated they could see me placing lots of calls and could even tell me the numbers I was attempting to call. BUT, he said that the logs suggested that they were successful... they clearly were not, so I'm not sure how to interpret that!

Can anyone out there make any suggestions on the NAT'ing and other configuration that might help - I'm assuming that it is just a problem with the NAT side of things...

My best bet would be to study about Asterisk - there is useful site called

Bulek is right, you have to start in Asterisk. Run:asterisk -rfrom a ssh session in the core, then type "sip debug" which will enable sip debugging (possibly deprecated command, but still works). Then when you make a call, you will want to watch for the "INVITE" message being sent from your core to your Voip provider (as opposed to the one from your internal phone to the core). There you need to see what number string you are sending to the provider and compare this to how the provider expects the calls (for example do they need a leading 1 for USA, or not).Until you don't see the calls being sent out in the right format, it will not work, and this is a dialplan problem. Only once the calls are going out in the right format, then you may be facing provider issues or NAt issues (unlikely because Asterisk should handle all that properly).

I started playing with VoIP a month or so ago after I signed up for my broadband provider's VoIP. I understand from previous comments (I think Zaerc or Thom) that SIP can be a little challenging to setup when you are routing over NATs - assuming this is because of the UDP component.

Oliver - quick question. Would love just to use the wizard, but there are only a handful of VoIP providers there, and certainly no Australian ones, so its not really an option! Whatever happened in the opening up of this? Ages ago there was a plan to add the basic parameters for lots more providers, but then I recall the approach changed from having a custom script do all the work to abstracting the providers' data into a separate file from the script to make it much easier to add new providers.

After that I don't recall seeing any more and RC2 just looks like the same providers in the setup wizard...

Haven't played with telephony for several weeks and was just above to restart, hence this topic. Now I have, seems I can make outbound calls after all.... no idea what changed.

However - the call connects (no Caller ID even though I have set it in the trunk and extension) but the line is absolutely dead - no sound whatsoever in either direction. I found some config advice for Freepbx and my provider and used that. Then the call cannot complete and in the log it says it can't find something to do with audio (can't remember the exact message) - assumed this was to do with the codec, so I removed disallow=all and left in allow=g729 (both of which came from the advice) and set the SIP phone to G729.

Now I can make calls again, but still no sound at all... and no messages in the log that are obvious (even/especially with debug turned on!)

The other thing is I cannot make inbound calls at all. But I am clearly getting through to the core because I can see debug events with my mobile phone number coming from my provider's IP addresses, and I can hear the "The number you have dialed is not in service" message coming from Asterisk (I know it is Asterisk because clearly QoS is not setup correctly and it is all distorted, plus its an American accent, and I'm in Australia)

This last bit, to me, suggests there is still a codec issue as some audio at least can get down the line, even if it is just Asterisk telling me it can't complete the call!

I have an inbound route that has the DID and CID matching fields blank, which apparently means it will accept all calls. And the Set Destination is set to send the call to the extension I am testing with....

OK, got an inbound call working only by setting the Allow anonymous inbound SIP calls setting in the general settings section... The help on that suggests that this might be bad by allowing anyone to initiate a call with me (although my NATs wouldn't allow that).. should I be concerned? Why is the call not authenticated?

Still have the audio issue though, but it seems to have changed slightly (or more likely my understanding of it after testing!)

Both inbound and outbound calls connect (Caller ID only works on inbound calls), but no audio at all in either direction....

But this is the kicker - if I put my SIP phone on hold, suddenly I can hear the on hold music on my mobile phone. If I unhold, audio comes to life perfectly in both directions! This is true whether the call is inbound or outbound initiated...

Smacks of NAT issues again... Have been searching around but still can't find a certain answer on what ports I should be forwarding to the core (don't really care that this is an open forward at this stage, I trust the core's firewall!) Have forwarded SIP on UDP/5060, but what about RTP? One doc suggested ports 8766-35000, assuming UDP only. Didn't make any difference, and the audio still works after the hold/unhold thing even without any RDP, so I'm assuming it is somehow initiating the stream outbound irrespective of the bound-ness of the call...

Final update for the day - after much messing around, with firewall rules (RTP on ports 10000-20000), and setting the externip, etc. It finally all sprang to life. Both inbound and outbound calls worked perfectly, and audio in both directions.

Then realised that I had added the extension directly into Freepbx so LMCE knew nothing about it. It didn't seem to mind and would happily receive calls from the extension, just didn't present it as an option anywhere.

So I decided that as it was the general config (sip.conf and sip_nat.conf and sip_additional.conf) and the firewall rules I had been playing with, not the extensions. I would just remove the extension I added directly. And add a device in LMCE properly (as I have done before). After a few reloads and regens, I got LMCE to accept the device and auto-create the extension in Freepbx again. Calls still working.

So I decided to do a full reboot, just to make sure everything was OK. Bang! No outbound calls now (all circuits busy) but inbound calls work perfectly, CallerID and everything!!!

The "full" log is now logging events in debug mode saying something about authentication:

presumably internode/Broadworks is your voip provider, yes?If so, what this means is that they did not accept your request to authenticate in their sip proxy. Could be because of another registration waiting to time out, but judging by the time between your messages, I would doubt that.So the most obvious reason would be to double check once again the login and password you supplied for your voip provider line. First in LMCE, and if that doesn't help, then maybe in AMP?A let obvious reason could be that your voip provider blocked you if you're out of funds or something?

In AMP you should see in the overview that the "trunk" for outbound calls is "offline", becuase of the problem above, and the consequence obviously is that you cannot make outbound calls.

When I had similar problems (but caused mostly by a bugged sip proxy), doing a "reload" from the asterisk console (asterisk -r) would sometimes help, as asterisk would try to negoatiate the authentication again from scratch with the sip proxy.

No idea who Broadworks is, but Internode is my VoIP (and ISP) provider, yes. I agree it does look like they are rejecting my connection attempts, however 1) I can make inbound calls, no problem and 2) it was working perfectly for inbound and outbound for hours, so I decided to reboot and as soon as I did that, outbound calls died.

I double checked the login and password and it definitely hasn't changed (it my phone number and my normal ISP password) from prior to the reboot. I check this in the FreePBX interface under Phones Setup in the admin console. Which I assume you meant by AMP, given that I am configuring my VoIP using the "manually" option in LMCE, is there another place I should be looking in for these details? You seem to suggest there is one for LMCE and one for FreePBX/AMP....

In the FreePBX System Status, it confirms that the (1) trunk is online and registered (2 different bar charts). Occasionally I see the registered bar drop to 0 and then go back to 1, which I assume is the trunk normally reregistering itself? When I attempt an outbound call and get the "all circuits busy" message, I see the "total active calls" and "total active channels" bar charts jump to 1. But the internal and external calls bar charts stay at 0.

When I try to make an inbound call, this succeeds and connects. Now I see the "total active channels" at 2, and both the "total active calls" and "internal calls" at 1. But "external calls" is 0.

The trunk seems to be in place, and for the life of me the dial plans are as before when it worked and seem to make sense (should be matching my calls), just doesn't dial out. If the authentication with my provider were the issue, wouldn't calls in both directions fail?? What else can I do to troubleshoot this?

sorry it's really difficult to say what the problem is, since it's basically the voip provider who doesn't like you at the moment, and they are the best suited to say why.There shouldn't be a different password in LMCE or FreePBX (which web admin seems to be called AMP). i just wasn't sure if you were in manual mode or not. In the normal mode, the password would be written by the user in the LMCE admin whcih would then write it into Freepbx, so if it's correct in freepbx, that's all that matters.Did you try the "reload" at the asterisk console? This refreshes the sip proxy registration and has helped me in the past.

It seems that the "not authorized" message comes in response to your INVITE, so if you are really registered into Internode's servers (according to freepbx which shows the trunk as online), then there is a small possibility that Internode just doesn't like that particular call. I assume that dialing domestic calls with a leading 0 is the correct format expected by internode.You did check that it was not a balance/credit issue with them, right? Did you try calling a different number? Maybe you could try an international call as well (in case it's a dialplan issue). They should expect those either starting with the country code (E164 format) or with a 00 in front (or whatever the correct code may be in your country for international access). If that works, then you will want to format your domestic calls into the same international format (by adding your own country code) and see if that helps.

Depending on how responsive their support is, you could simply ask them what they don't like about your calls, maybe it will enlighten us?

PS: I'm not completely sure if seing the registered trunk drop to 0 in FreePBX is normal or not, but I *believe* I've seen the same in my system on occasion.

Strange! Thanks Jean, seem to have sorted it now, but not sure how... either a password issue with the provider (they swear blind that the password I was using successfully for days could not possibly have worked!) or the outbound trunk config required username attribute as well as the fromuser attribute, but again, it was working perfectly for days with only the latter... either way, I'm not screwing with it any more as it works now

Out of interest, should the Call routing section of the web admin actually be routing calls as it suggests, or does this not work when in "manual" mode, or have I messed it up by configuring parts manually? Obviously, setting up extensions/phones through the web admin rather than the FreePBX interface is necessary so that LMCE knows about them as devices and can do its stuff, but it isn't clear to me how much of the other configuration you can safely configure through the FreePBX. At the moment inbound calls just ring and ring and never divert in line with the web admin config. I know you can configure IVR through FreePBX as well, but don't want to get LMCE in a knot!

Actually another question about the LMCE call routing - given that it is by user, how can it know which user's rules to follow unless the IVR picks up first and asks the caller which user they are calling for? Does it have to be determined via the caller ID? or have separate indial numbers?