[ASK] How to make call between IAX2 using same extentions

Dear All,

I have 2 Asterisk server on different country, the connection between Asterisk server already setup.
And now time make dialplan, my plan is make the extention still same, i do this
because my user is mobile person.
For now, if somebody call 3022, from server A or server B,
Cisco IP phone on his desk ringing, and Softphone on his laptop also ringing, but the problem its
the call doing looping, i look like i wrong on logic when using “&”, but i don’t know other method.

sample:

;part of extentions.conf on RUSIA
exten => 3022,1,Dial(SIP/robert&IAX2/GERMAN/${EXTEN},20,t)
same => n,Congestion()
same => n,Hangup()

;part of extentions.conf on GERMAN
exten => 3022,1,Dial(SIP/robert&IAX2/RUSIA/${EXTEN},20,t)
same => n,Congestion()
same => n,Hangup()

somebody can fix my dialplan? Great apreciate for any help.

Regards,

Catty Melissa

The problem is probably because when the call comes in from the IAX2 trunk, it finds the local extension of 3022 and does exactly what is it told to do, call the local SIP device and call the remote extension via the IAX2 trunk. Then the far end does the exact same thing.

You need a way of separating the inbound call via IAX2 from a normal dial. This can be done via having a different context as the target for the IAX2 trunk calls. As an alternative, you could create a special extension, such as from-rusia-3022, which only dials the local SIP. You could also check some channel variables to see if the call is coming in via the IAX2 trunk. I think you can also send variables over the IAX2 trunk, but I have never tried that.

Thank you very much for your reply,
yes you right, because that my dial plan start looping.
can you give the dialplan syntax, because im new on asterisk?

Thank you.

Regards,

Catty Melissa

SOLVED. Thank you very much your advice its very help dalenoll.