Linking two asterisk systems with IAX2

Greetings all. I’m rather new to VoIP and *, but have been doing a fair amount of research. I’ve successfully set up systems both at my home and my corporate office and they work very well. What I can’t seem to figure out is how to link them to each other. The problem is twofold:

o I have a dynamic IP at home, although it is registered with DynDNS. My network is NATed through my router, but I have all of the appropriate ports forwarded.
o I can’t make a backwards path from home to work (i.e. forwarded ports on the corporate external IP to my * server) as I don’t have access to that equipment.

Is it possible to connect these two servers such that I can both send and receive calls? I’ve been reading about IAX2 trunks, but everything I’ve read suggests that they are one-way. Is it possible to have the office system maintain a two-way connection with my home server using IAX2?

TIA for your help!

Hi,

So your Office Asterisk has a static IP? You should be able to make it work

This is from iax.conf

; We can register with another IAX server to let him know where we are
; in case we have a dynamic IP address for example
;
; Register with tormenta using username marko and password secretpass
;
;register => marko:secretpass@tormenta.linux-support.net

Yes, internal to our corporate network it has a static IP, but everything on our corporate LAN is NAT’d down to a single external IP for security purposes. So in both cases it has a fixed IP, per se.

Hi,

I read your post and thought I could make use of the same setup.
Here is what I did to get it working I am not a guru I would like to see how others would do the same setup.

The first thing I did was to make sure I had connectivity between home and office;
I used iaxping, tcpdump, wireshark; I wanted to inspect the packets and make sure everything was working as expected.

Then;

;Home - dynamic IP Ext. range 9XX
;iax.conf
register => 120:888@123.123.123.1

[120]
disallow=all
allow=g729
host=123.123.123.1
secret=888
username=120
auth=md5
type=friend

;extensions.conf
exten => _1XX,1,Dial(IAX2/120/${EXTEN},30)
exten => _1XX,2,Hangup()

;Office - Static IP Ext. range 1XX
;iax.conf

[120]
username=120
secret=888
disallow=all
allow=g729
type=friend
host=dynamic
context=default
auth=md5
qualify=yes

;extensions.conf
exten => _9XX,1,Dial(IAX2/120/${EXTEN},30)
exten => _9XX,2,Hangup()