RTP going to wrong IP address

Im running FreePBX on two seperate machines. Both are on different IP’s running behind NAT.

I’m working un setting up dundi between the two and the extensions are working. Can query, and can call. However there is no sound passing through. I have all the ports open on the two firewalls and have added the IP’s to Sip_Nat.conf.

For my testing I have an IP phone at location 1 and an IP phone at location 2 and I also have a softphone installed on my computer that is registered to server #2. I am at the location for server #1. So my goal was to call server 1 extension from the softphone.

I can make the call, both ways. But no sound. I did an RTP debug and noticed that the RTP packets on server 2 are being sent the the internal ip address on server 1

Sep 17 11:33:52 VERBOSE[4095] logger.c: Sent RTP packet to (type 0, seq 24207, ts 35520, len 160)
Sep 17 11:33:52 VERBOSE[4095] logger.c: Sent RTP packet to (type 0, seq 24208, ts 35680, len 160)

Now, I set both networks up and since they are single seperate networks I used the same address pool. Both are 192.168.0.x . My computer is and the softphone running off of it is registered to server 2. So should the RTP packet not be sent to the domain and not to the local IP.

What have I missed. I’m sure it’s somthing stupid.


It sounds like improper sip_nat.conf settings off hand. Take a look at the site’s how-to section, I posted a how-to on setting this up.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

I looked at the working behind nat and have checked both sites sip_nat.conf

Site # 1


site # 2

All phones register and all can call each other. Dundi works ok, just no audio.

Ok, I saw one mistake that I didn’t notice before and change

Site # 1

localhost= <— this to localhost=

site # 2
localhost= <----- this to localhost=

still not working

Now, after making the changes above, and doing an amportal stop, amportal start. When I call an extension it automatically goes to voice mail. No ringing no nothing.


10.x.x.x is a private address range? That can not be the external IP?

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

Sorrry, should have made that more clear. I changed the ip’s from my actuals.

shouldn’t it be

(rather than localhost)

yup and shame on me for the typo in my instructions. They are fixed.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

Thanks for the help guys. Making the changes from localhost to localnet solved the problem.

I did run into another problem, but it some how fixed itself.

My dundi lookup was working in only one direction. I could call server 2 extension but when server two put in an extension for server one it always came back and said it was unavilable. I searched every where and could not find why.

I was looking in my extension_additional.conf file and noticed that there was no follow me information for any of the extension on server 2 but there was on server 1. So I added a follow me to one of the extensions on server 2 and all started working fine. But I don’t know how that fixed it.

I worked on this for 3 hours and don’t really know what I did to fix it. I’m now affraid to reboot either machine as they are working the way I want them.

Once question. If I was to share dial plans with dundi, where would I put the lookup in my extension_custom.conf file. Do I create a new context. Here is my extensions_custom.conf

; This file contains example extensions_custom.conf entries.
; extensions_custom.conf should be used to include customizations
; to AMP’s Asterisk dialplan.

; All custom context should contain the string ‘custom’ in it’s name

; Extensions in AMP have access to the ‘from-internal’ context.
; The context ‘from-internal-custom’ is included in ‘from-internal’ by default

#include extensions_trixbox.conf
#include extensions_hud.conf


include => from-internal-trixbox

;1234,1,Playback(demo-congrats) ; extensions can dial 1234
;include => custom-recordme ; extensions can also dial 5678

; custom-count2four,s,1 can be used as a custom target for
; a Digital Receptionist menu or a Call Group

; custom-recordme,5678,1 can be used as a custom target for
; a Digital Receptionist menu or a Call Group
;exten => 5678,1,Wait(2)
;exten => 5678,2,Record(/tmp/asterisk-recording:gsm)
;exten => 5678,3,Wait(2)
;exten => 5678,4,Playback(/tmp/asterisk-recording)
;exten => 5678,5,Wait(2)
;exten => 5678,6,Hangup

; This is the dundi information to link office dial plans.

include => trydundi-extensions

include => ext-queues

include => dundi-services

switch => DUNDi/services

;include => dundi-services-local
include => dundi-services-switch

exten => s,1,Goto(${ARG1},1)
include => dundi-services-lookup

; Currently no remote services

include => ext-local

include => dundi-extensions

switch => DUNDi/extensions

;Don’t go to extensions, otherwise we loop
;include => dundi-extensions
include => dundi-extensions-switch

exten => s,1,Goto(${ARG1},1)
include => dundi-extensions-lookup

exten => _[13]XXX,1,Macro(user-callerid,SKIPTTL)
exten => _[13]XXX,n,Macro(record-enable,${CALLERID(number)},OUT)
exten => _[13]XXX,n,Macro(dundi-extensions,${EXTEN})
exten => _[13]XXX,n,Congestion(5)
exten => _[13]XXX,n,Hangup

exten => _7X,1,Goto(parkedcalls,${EXTEN},1)

include => dundi-parking

switch => DUNDi/parking

include => dundi-parking
include => dundi-parking-switch

exten => s,1,Goto(${ARG1},1)
include => dundi-parking-lookup

; no remote parking

Thanks for all your help.