Help with calls not working and one-way audio

I am having a strange problem that I hope someone can help me figure out. I have a freepbx system with 3 nic cards in it. We are using wfs - WAN Failover Script for WAN failover.
Nic 1: external ip (Static ip connected directly to primary isp…verizon)
Nic 2: external ip (Static ip connected directly to secondary isp…comcast)
Nic 3: internal ip (dhcp connected to switch and ip is gotten from sonicwall firewall…using static mac dhcp so it always gets the same ip)
Polycom Phones: (dhcp connected to same switch as Nic 3 and all phones get from Sonicwall using static mac dhcp)

The problem started when I changed Nic 3 from static ip in freepbx to dhcp. I also changed the phones to get dhcp from Sonicwall instead of the freepbx box.

When I called Bandwidth.com to diagnose the problem, they told me that my contact was showing private ip instead of a public ip. I asked him to email me a good and bad sip transaction. I am posting both:

++++++++++++++++++++++++++++++++Begin GOOD+++++++++++++++++++++++++++++++++++++++++
SIP/2.0 200 OK
Via: SIP/2.0/UDP 216.82.224.202;branch=z9hG4bK1391.95b9e912.0;received=216.82.224.202
Via: SIP/2.0/UDP 216.82.224.202;branch=z9hG4bK1391.85b9e912.0
Via: SIP/2.0/UDP 67.231.8.93;branch=z9hG4bK1391.0d06e9d2.0
Via: SIP/2.0/UDP 192.168.27.72:5060;branch=z9hG4bK0bBda106ab11b851b23
Record-Route:sip:216.82.224.202;lr;ftag=gK0b225598
Record-Route:sip:67.231.8.93;lr=on;ftag=gK0b225598
From:sip:[email protected];tag=gK0b225598
To:sip:[email protected];tag=as43c3dcdf
Call-ID: [email protected]
CSeq: 18717 INVITE
Server: Asterisk PBX 1.6.1.9
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact:sip:[email protected] ******Public IP which is correct
Content-Type: application/sdp
Content-Length: 265

v=0
o=root 1269644224 1269644224 IN IP4 74.XXX.XXX.XX
s=Asterisk PBX 1.6.1.9
c=IN IP4 74.XXX.XXX.XX
t=0 0
m=audio 13666 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
++++++++++++++++++++++++++++++++End GOOD+++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++Begin BAD+++++++++++++++++++++++++++++++++++++++++
SIP/2.0 200 OK
Via: SIP/2.0/UDP 216.82.224.202;branch=z9hG4bKbbdb.6e13bc43.0;received=216.82.224.202
Via: SIP/2.0/UDP 216.82.224.202;branch=z9hG4bKbbdb.5e13bc43.0
Via: SIP/2.0/UDP 67.231.8.93;branch=z9hG4bKbbdb.fa6fa0d5.0
Via: SIP/2.0/UDP 192.168.27.72:5060;branch=z9hG4bK0bBaeee110d190bea62
Record-Route:sip:216.82.224.202;lr;ftag=gK0b0fe17b
Record-Route:sip:67.231.8.93;lr=on;ftag=gK0b0fe17b
From:sip:[email protected];isup-oli=62;tag=gK0b0fe17b
To:sip:[email protected];tag=as5cff1fa2
Call-ID: [email protected]
CSeq: 15633 INVITE
Server: Asterisk PBX 1.6.1.9
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact:sip:[email protected] ****Incorrect IP (Private IP)
Content-Type: application/sdp
Content-Length: 259

v=0
o=root 1797607776 1797607777 IN IP4 172.16.2.1
s=Asterisk PBX 1.6.1.9
c=IN IP4 172.16.2.1
t=0 0
m=audio 15106 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
++++++++++++++++++++++++++++++++End BAD+++++++++++++++++++++++++++++++++++++++++

How do I force a public ip in the contact all the time?
In the GOOD it says: Contact:sip:[email protected] {Public IP}
In the BAD it says: Contact:sip:[email protected] {Private IP}

When I look in sip.conf, it says to only modify through freepbx gui. I am not sure where to modify this?

Here is my Trunk details:
Peer Details:
type=peer
port=5060
nat=no
host=216.82.224.202
fromuser=+1410XXXXXXX
dtmfmode=rfc2833
disallow=all
canreinvite=no
allow=ulaw

USER Details:
type=peer
port=5060
nat=no
host=216.82.224.202
dtmfmode=rfc2833
disallow=all
canreinvite=no
allow=ulaw

Register String:
Blank

****Sometimes when you make a phone call incoming or outgoing:
-It goes through immediately
-Other times, it takes a few minutes to connect
-Sometimes, it never connects

Thanks
-Dimitry

asterisk21st,

Thanks for your help. I changed back the hostname to the original hostname and thought I had it fixed but then today at 2pm it would not receive or send calls. I am trying to figure out if I have all the sip*.conf stuff setup correctly.

Thanks
-Dimitry

I had an issue where my audio would drop out anywhere from 30 seconds to 3 minutes into the call and the caller would not hear me (asterisk side) but I could continue to hear them.

Some people mentioned issues with bandwidth.com and no resolution from that VOIP provider. It just so happens my voip carrier uses bandwidth.com but I contacted my voip provider (voipo) and they could not see any issues on my end.

My issue was the asterisk box was connecting to the voip provider using a loop back address! I don’t know how this happened but my only guess was that I changed the hostname shortly before this started to happen.

my thread which may help with some issues you had
http://www.freepbx.org/forum/freepbx/users/sip-nat-conf-help-for-audio-dropout-update