Interconnect 2 Asterisk servers

i’m trying to connect 2 servers using IAX trunk, but here what i’m thinking to do but please let me know if i’m wrong.

Sip phone (G.711) -> *(IAX2)(G.729) -> Internet ->(G.729) *(IAX2) ->(G.711)-> Sip phone .

actually i’m trying to use G.729 to save bandwidth but inside the office i’ll use G.711. the question now is that gonna work? do i need license since i want a voice mail beteen local and remote extension?

The only way Asterisk can use g729 without you installing the codec and buying the licence, is by passing it through from one end of the connection to the other. It can’t transcode between g711 and g729 without that. You also won’t be able to do voicemail over g729 connections without it.

Making Asterisk work properly with passthrough g729 streams isn’t necessarily a simple matter either!

can i use gsm for connecting the servers even the phones don’t support it?

Yes. But not if the phones are talking g729 to the server and you haven’t got a g729 codec.

If, say, the phones are using g711 you can use gsm between the servers without any problems. This is a good option as Asterisk can translate between g711 and gsm very quickly and it doesn’t add much latency to the round trip at all.

To find out what translation possibilities you’ve got, and the cost of each one in terms of latency, do the following on the Asterisk console:

show translation