Skip to content

Configuring an IAX2 Trunk to Les.Net is one of the VOIP providers I’m using, especially for outbound traffic. Their rates are pretty good, however I just can’t get inbound SIP calls working from them, despite configuring sip_nat.conf, turning on insecure=very and port forwarding all the SIP port ranges to my asterisk server. Inbound SIP from Junction Networks works perfectly, but they’re also more expensive, so I only use them for a local DID.

Documentation around the web on getting an IAX2 Trunk working with Les.Net is either sparse or wrong, at least currently. Perhaps some of the older forum posts used to work. I’m not sure, though – many contain some ‘out there’ ideas. This post aligns closely with configuration examples for SIP, just with the essential unexplained details to get each field just right. Who knows, perhaps some other network configurations need wild-and-crazy setups.

Anyway, on Les.NET, create a new peer, edit it, give it:

Peer Technology: IAX2

And leave everything else blank or default – but select the codecs you can actually handle.

For Trixbox, create a new IAX2 Trunk.

Outbound Called ID: 1_PLUS_YOUR_NUMBER

PEER Details:

USER Context: from-trunk
USER Details:

And for Register String:

Now, add that to an outbound route (I have it after the SIP route, which works in the outgoing direction and they seem to prefer), and create a new inbound route.



and save. Apply changes and you should be good to go. Now, go back to and verify that the IAX channel has registered and that it got your IP address. If it has, go ahead and assign your DID to this peer on the webpage.

If not, go in to a command line and have a look at the IAX2 debugging information:

/usr/sbin/asterisk -r
set iax2 debug

Upon proper registration you’ll see an IAX2 message ACK’ing the registration with your outside IP address.

Somebody really needs to define a schema for these kinds of configurations (a WSDL, perhaps?) and describe a web service such that the providers can provide simple description files and distros like Trixbox can understand how to parse them for setup. There are far too many possible variables, variations, lack of standards, and adherence to those aforementioned standards for the laity to stand a chance at building a working configuration. It took me four hours just to figure this one out, and that ain’t cool.

1 thought on “Configuring an IAX2 Trunk to Les.Net”

  1. Hey, thanks a lot. I’ve been looking for exactly this and it works great.

Comments are closed.