Please Help - PORTS, subdomain, NAT, WTF! lol

JCMilleniuM

Joined
Oct 7, 2010
Messages
10
Likes
0
Points
0
#1
I'm using elastix for about 2 - 3 months

My configuration:

LAN:
Elastix is on my LAN has IP 192.168.0.5/255.255.255.0
SPA3000 with IP 192.168.0.6 (trunk with PSTN and one analog wireless phone on the FXS)

WAN:
Modem/Router Motorola MTA with Port forwarding (5060 & 10000-20000) to my Elastix box with Dinamic IP.
The modem has a DDNS Client which I setup with NO-IP address.

For now it's working more or less fine. Except that when I try to connect to the no-ip address it just doesn't connect, so what I do is to figure the ip of my WAN by doing a ping to the no-ip address and then set the softphone to the IP address. It works fine but it's really annoying.

I configured the Elastix box IP with FreePBX without embbebed by going into:
Tools -> Asterisk SIP Settings

Setting
NAT -> Never
IP Configuration -> Static IP
External IP -> XXX.XXX.XXX.XXX
Local Networks -> 192.168.0.0/255.255.255.0

I know I have not used the proper settings above but this is the only way that works, I have tryed to use IP Configuration set to dinamic and with the no-ip address but it doesnt work I mean I do not get audio either in one or other way.

I want to be able to use the no-ip address since i want to use an ipkall number to receive calls from USA and I cannot make it work.

Also I have a problem with the IVR not playing an mp3 message I uploaded, does anyone knows the voltage Ecuador's analog lines work with since the SPA3000 won't free the PSTN line since it doesn't hang up inmediatly (goes to voicemail records nothing and the hangs up).

Please would you help me with this. I have tried almost everything to solve the problem.
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#2
Maybe this will help some properly identify their sip nat settings from Digium asterisk source code ./contribs/scripts/sip_nat_settings :-


Code:
#!/bin/sh

# sip_nat_settings: generate NAT settings for sip.conf of an Asterisk system
#                   that is behind a NAT router.
#
# This is a script to generate sane defaults for externip and localnet 
# of sip.conf. The output should be included in the [general] section of 
# sip.conf .
#
# Multiple network interfaces: If you have multiple network interfaces, 
# this script will generate a 'localnet' line for each of them that has a 
# broadcast (ipv4) address, except the loopback interface (lo). You can 
# later rem-out all of those you don't need.
# 
# Alternatively, provide a network interface as a parameter an a localnet 
# line will only be generated for its network.
#
# Copyright (C) 2005 by Tzafrir Cohen <tzafrir.cohen@xorcom.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

WGET=`which wget`
FETCH=`which fetch`
if [ -x ${WGET} ]; then
	externip=`${WGET} -q -O- http://www.whatismyip.org`
elif [ -x ${FETCH} ]; then
	externip=`${FETCH} -q -o - http://www.whatismyip.org`
else
	echo "no binary found to contact http://www.whatismyip.org"
	exit 1
fi

# optional parameter: network interface to use. By default: none.
IFACE="$1"

OS=`uname -s`
case "$OS" in
Linux)
  echo "externip = $externip"
  /sbin/ifconfig $IFACE | grep 'inet addr:' | grep Bcast \
  | sed -e 's/^.*Bcast:\([0-9.]*\)\s*Mask:\([0-9.]*\)\s*$/localnet = \1\/\2/'
  ;;
OpenBSD|FreeBSD)
  if [ "${OS}" = "FreeBSD" ]; then
	  VER=`uname -r | cut -d . -f 1`
	  if [ ${VER} -lt 7 ]; then
		  echo "Unsupported OS"
		  exit 1
	  fi
  fi
  echo "externip = $externip"
  ip=`/sbin/ifconfig $IFACE | awk '/\tinet .* broadcast/{print $6}'`
  x=`/sbin/ifconfig $IFACE | awk '/\tinet .* broadcast/{print $4}'`
  printf 'localnet = %s/%u.%u.%u.%u\n' $ip $(($x>>24&0xff)) $(($x>>16&0xff)) $(($x>>8&0xff)) $(($x&0xff))
  ;;
*)
  echo >&2 "$0: Unsupported OS $OS"
  exit 1
  ;;
esac
 

JCMilleniuM

Joined
Oct 7, 2010
Messages
10
Likes
0
Points
0
#3
is it complete?
Thanks!
 

JCMilleniuM

Joined
Oct 7, 2010
Messages
10
Likes
0
Points
0
#4
Nop, it give me the WAN ip, which is allready set in the elastix box, ans I'm telling you I have no problems connecting from outside but when I use a subdomain pointing to my wan ip it will not work
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#5
That script is for static IPs If the dynamic dns service resolves to your current IP address, use

externhost=<yourdomain>
nat=yes
localnet=192.168.0.0/255.255.255.0
externrefresh=10
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,564
Latest member
Mai Tuyen
Top