Trunk provider reports "Connect" and "Via" contain wrong IP addresses

After trunk registration, FreePBX sends the provider “Connect” and “Via” fields which contain the IP address to which the call should be sent.

The trunk provider (Broadvox) claims that I am sending an incorrect IP address, so they are sending the calls there, which results in no-way audio (the phone rings, but no audio either way on either phone). They are not very knowledgeable/helpful beyond that.

We have multiple static IPs and are using NAT internally.

  • router/port forwarding (not used for VOIP) is at public static 68.157.194.242
  • pbx is at public static 68.157.194.246, with NAT address of 192.168.20.122

The “Connect” and “Via” fields contain the IP address of the router (68.157.194.242

Where are these values set in FreePBX?

PBX in a Flash Version 1.3

  • Running Asterisk Version : Asterisk 1.4.21.2
  • Asterisk Source Version : 1.4.21.2
  • Zaptel Source Version : 1.4.12.1
  • Libpri Source Version : 1.4.7
  • Addons Source Version : 1.4.7
    CentOS release 5.2 (Final) :32 Bit Kernel: 2.6.18-92.1.6.el5

machine name is pbx.metamedia.us, which resolves to .246

sip_custom.conf:
externip=68.157.194.246
from_domain=68.157.194.246
externrefresh=120
nat=yes
verify=yes
qualify=yes
localnet=192.168.20.0/255.255.0.0
defaultexpirey=3600
srvlookup=no
disallow=all
allow=ulaw
allow=alaw

sip_nat.conf:
nat=yes
externip=68.157.194.246
from_domain=pbx.metamedia.us
localnet=192.168.0.0/255.255.255.0
externrefresh=10

PEER Details:
allow=ulaw
canreinvite=no
disallow=all
fromdomain=68.157.194.246
host=209.249.3.59
insecure=very
nat=yes
type=peer
username=8653296634
secret=xxxxxxx
fromuser=8653296634
port=5060
qualify=yes

USER Context:from-trunk

USER Details:
allow=ulaw
context=from-sip-external
disallow=all
host=68.157.194.246
insecure=very
type=user
nat=yes
canreinvite=no

Any insight is very much appreciated. I have been banging my head against this for weeks now and am about to give up. What’s strange is that everything worked fine with VoicePulse, but they were not able to get DIDs in my city so I had to find another trunk provider.

Thanks
-c!

Try this:

Remove the lines you added to sip_custom.conf - you are using that in totally the wrong way.

To set up sip_nat.conf properly, read HOWTO: Resolving Audio Problems (which may also give you some other hints should you still have issues). Try it exactly the way it’s shown there (don’t use externrefresh=10 if you are using externip=).

After making those changes try it and see if it works. If not, then…

Remove the USER context and USER details in your trunk (you should not be calling the user context from-trunk in any case!). But under the PEER details, add the line context=from-trunk (there has to be a context statement somewhere for calls to come in). I think the USER context is supposed to be the same as your DID (865xxxx634) but since most providers treat you as an extension rather than a peer, most of the time the USER settings are ignored. Broadvox might be an exception but in any case I think you are going to have a problem as long as you call the USER context from-trunk (since you are using a context name twice!).

Also, you did not state the format of your trunk registration string - make sure that is constructed correctly.

That that and let us know if it fixes your problem.

Oh, by the way, it’s really not a good idea to publish your machine’s network address or your phone number in an open forum such as this. You might want to edit those out or at least partially obscure them, unless you are really confident that you have your system secured.

First, as wiseoldowl indicated secure your system, it is wide open.

I have extensive experience with Broadvox, they treat you as a B2BUA, not an extension and send you SIP calls from 4 softswitches. You do not register with Broadvox you tell Asterisk who they are to create a peering relationship.

Here is a complete working set of peers for Broadvox, these are also the correct IP’s. Note the username, I added this statement it is not a Broadvox generated username. The purpose of it is to tag inbound DID calls for proper display in FOP and CDR’s. You can also increase the count in the FOP config to display each channel.

With this config you do not need anonymous inbound on. Also take all that stuff out of sip_custo.conf. You can add your externip and localnet to sip_nat.conf or sip_general_custom.com (one or the other not both).


Outbound Settings:

Trunk Nane: Broadvox

Peer Details:

disallow=all
allow=ulaw
canreinvite=no
dtmfmode=inband
host=64.158.162.78
insecure=very
port=5060
qualify=yes
type=friend


Incoming Settings:

User Context:  Broadvox_DID

User Details:

disallow=all
allow=ulaw
canreinvite=no
dtmfmode=inband
host=64.152.60.74
Username=BV_DID
insecure=very
port=5060
qualify=yes
type=friend

Thanks very much for the responses. I’ve made changes based on your comments, but am still experiencing the same problem.

The config I posted was kludged together from basic info from Broadvox tech and several config recipies I attempted to integrate as I am having no luck getting this to work.

For some reason, FreePBX is using “68.157.194.242” in the Connect and Via strings (instead of .246), inhibiting voice stream connection.

wiseoldowl:
I have gone through that article already and followed the advice, but no joy.

SkykingOH:

  1. My trunk may differ from your experience with Broadvox. It is a dynamic account, so I must pass username and secret in order for registration to succeed. My trunk host is stated on my turnup ticket as 209.249.3.59, so it looks like I am using different servers than you. I am registering with the trunk and placing outbound calls… just no voice either way on pickup.

  2. I’m all for securing the OS: I’ve followed locked down procedures and changed all the defaults. I left port 80 open for testing (and hope to use SSL after I can get this work). I’ve left all UDP open in the firewall for now as well. If I can get this to work I’ll secure further.

If there a reference manual for all these settings? All I’m finding are recipes and tutorials, so it’s hard to more than trial and error.

Here’s where I am now: with the same problems of no audio either way:

sip_custom.conf: (empty)

sip_nat.conf:
nat=yes
externip=68.157.194.246
from_domain=pbx.metamedia.us
localnet=192.168.0.0/255.255.255.0

rtp.conf:
;
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
rtpstart=10001
rtpend=20000

PEER Details:
allow=ulaw
canreinvite=no
disallow=all
fromdomain=68.157.194.246
host=209.249.3.59
insecure=very
nat=yes
type=peer
username=8653296634
secret=my_secret

USER Context:
8653296634

USER Details:
disallow=all
allow=ulaw
canreinvite=no
dtmfmode=inband
host=209.249.3.59
Username=8653296634
insecure=very
port=5060
qualify=yes
type=friend

Register String
8653296634:[email protected]/8653296634

Any insight is very much appreciated.
Thanks
-c!

Sorry to add to the confusion I am a wholesale Broadvox customer.

Anyway since the IP in your SDP is in your local subnet I am wondering if in all the changes you made you made a type.

I would go to /etc/asterisk and run the command ‘grep 68.157.194 *’ and take a look at what is going on.

Do you have any type of ALG in your router or firewall that may rewrite SDP’s

The command syntax for all the variables is at:

http://www.voip-info.org/wiki-Asterisk+config+sip.conf

Under Peer Details you need to have disallow=all before allow=ulaw. The configuration above has disallowed all codecs, so I don’t think you would have any audio even if all your other configuration options were correct.