How to connect 2 asterisk servers?

Hi all
I have 2 asterisk servers :

  1. the first one in france where I installed asterisk2billing and i created prepayed cards. So I have a code number, credit , …
  2. the second one in Morroco with a card which have 2 fxs and one fxo.

I want that if I call the number 022387594 which is the number of the line in the fxo in the server in morroco, it call the server in france who will ask me to enter my code, after i have x euros, and i can dial the number i want ?
what should i write in the files to connect the server in france and in morroco ?
any ideas or suggestions ?
thanks you very much in advance .

Maybe this will help … al+servers … +2+servers

i will read them now

you can connect using IAX2 tunnel

i tried to connect them by usind iax trunk but the server in france could not make the call. the server in morroco pass the call to the second server in france , but it do not finish th call?
any suggestions?

Post relevant part of your configs and logs of where the calls didnt work and maybe someone can figure it out

hi all
thanks a lot, finally the 2 servers are now connected.
but , as you know me , i always have problems !
thanks again