RTP going to wrong IP address

Im running FreePBX 2.3.0.3 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 192.168.0.2:18108 (type 0, seq 24207, ts 35520, len 160)
Sep 17 11:33:52 VERBOSE[4095] logger.c: Sent RTP packet to 192.168.0.2:18108 (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 192.168.0.2 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.

Rob

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

externip=10.0.0.1
localhost=192.168.0.104/255.255.255.0
nat=yes

site # 2
externip=10.2.2.1
localhost=192.168.0.230/255.255.255.0
nat=yes

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

externip=10.0.0.1
localhost=192.168.0.104/255.255.255.0 <— this to localhost=192.168.0.0/255.255.255.0
nat=yes

site # 2
externip=10.2.2.1
localhost=192.168.0.230/255.255.255.0 <----- this to localhost=192.168.0.0/255.255.255.0
nat=yes

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.

Rob

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.

Hi,
shouldn’t it be
localnet=192.168.0.0/255.255.255.0

(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

[from-internal-custom]

include => from-internal-trixbox

;1234,1,Playback(demo-congrats) ; extensions can dial 1234
;1234,2,Hangup()
;h,1,Hangup()
;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-count2four]
;s,1,SayDigits(1234)
;s,2,Hangup

; custom-recordme,5678,1 can be used as a custom target for
; a Digital Receptionist menu or a Call Group
;[custom-recordme]
;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.

[ext-local-custom]
include => trydundi-extensions

[dundi-services]
include => ext-queues

[dundi-services-local]
include => dundi-services

[dundi-services-switch]
switch => DUNDi/services

[dundi-services-lookup]
;include => dundi-services-local
include => dundi-services-switch

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

[trydundi-services]
; Currently no remote services

[dundi-extensions]
include => ext-local

[dundi-extensions-local]
include => dundi-extensions

[dundi-extensions-switch]
switch => DUNDi/extensions

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

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

[trydundi-extensions]
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

[dundi-parking]
exten => _7X,1,Goto(parkedcalls,${EXTEN},1)

[dundi-parking-local]
include => dundi-parking

[dundi-parking-switch]
switch => DUNDi/parking

[dundi-parking-lookup]
include => dundi-parking
include => dundi-parking-switch

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

[trydundi-parking]
; no remote parking

Thanks for all your help.