In article <[EMAIL PROTECTED]>, Josh Roberson <[EMAIL PROTECTED]> wrote: > Simon, i was having the exact same problem, the only solution I found, > was to remove the secret, then it worked great.. I thought I must have > been missing something too, but apparently not. I'm not sure exactly > what is causing this, as if i set the servers up to register with each > other, they register fine, but the moment they try to pass a call to one > another, they fail, unless there is no secret listed in iax.conf for the > connections.
It does work, but it took me a little digging to understand. The following is a simple one-way setup that should work: ---------- ServerA: extensions.conf [some-context] exten => some-extension,1,Dial(IAX2/userid:[EMAIL PROTECTED]/[EMAIL PROTECTED]) ServerB: iax.conf [userid] type=user secret=password context=acontext extensions.conf [acontext] exten => extension,1,Dial(wherever) ---------- You can make the dial string more concise by putting a peer section in the iax.conf for ServerA: ---------- ServerA: iax.conf [identifier] type=peer username=userid secret=password peercontext=acontext host=192.168.1.250 extensions.conf [some-context] exten => some-extension,1,Dial(IAX2/identifier/extension) ServerB: same as previous example. ---------- However, it is only in recent CVS versions (from 1.175 of chan_iax2.c on 2004/07/30) that it picks up the username as userid from the [identifier] section. In older versions it is still necessary to say Dial(IAX2/[EMAIL PROTECTED]/extension). In fact, when experimenting I also found it necessary to say [EMAIL PROTECTED], even when peercontext= was set. I haven't yet fully investigated why. If ServerB is on a dynamic IP address, then host=192.168.1.250 must be replaced with host=dynamic. It is then necessary for ServerB to register with ServerA by including the following in ServerB's iax.conf: [general] register => identifier:[EMAIL PROTECTED] where 123.123.123.123 is the IP address or hostname of ServerA. Note that it is identifier:password, not userid:password. I've deliberately kept the various names different to show which is dependent on which. That's also why I have keep peer and user separate instead of using type=friend. Bi-directional peering can be set up by swapping the above sections for ServerA and ServerB, changing names accordingly. With suitable choices of names, and the same secret in both directions, it is then possible to combine type=peer and type=user sections into a single type=friend, e.g. ---------- ServerA (static IP): iax.conf [serverB] type=friend host=dynamic username=serverA secret=password peercontext=from-serverA context=from-serverB qualify=yes notransfer=yes extensions.conf [outgoing-to-B] ;exten => outextenB,1,Dial(IAX2/[EMAIL PROTECTED]/[EMAIL PROTECTED]) exten => outextenB,1,Dial(IAX2/serverB/extenB) [from-serverB] exten => extenA,1,Dial(wherever-on-A) ServerB (dynamic IP): iax.conf [general] register => serverB:[EMAIL PROTECTED] [serverA] type=friend host=serverA.name.or.ip username=serverB secret=password peercontext=from-serverB context=from-serverA qualify=yes notransfer=yes extensions.conf [outgoing-to-A] ;exten => outextenA,1,Dial(IAX2/[EMAIL PROTECTED]/[EMAIL PROTECTED]) exten => outextenA,1,Dial(IAX2/serverA/extenA) [from-serverA] exten => extenB,1,Dial(wherever-on-B) ---------- As I said, it ought to be possible to omit the context from the IAX2 Dial commands if peercontext= is specified. I will investigate further. Hope this all helps! Cheers Tony (softins) -- Tony Mountifield Work: [EMAIL PROTECTED] - http://www.softins.co.uk Play: [EMAIL PROTECTED] - http://tony.mountifield.org _______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
