Inbound calls to second PBX via IAX2

Hi all
I’m trying to make the following scenario:
–> Inbound <–SIP–> PBX1 <–IAX–> PBX2—> internal ext.[1001]

We have one sip trunk to the ISP with sip numeric plan let say [01220 to 01299].
When received an incoming call to specific number, let say 01221 I want to place that call on the IAX route to the second PBX2.
It is Ok, but in the PBX2 site I see that the call is comming from 01221. The idea is to dial specific extension [1001], which is defined in PBX2 only. In General when someone dial sip nuber 01221 we want to transfer the call to the ext. [1001] via IAX.

I tried with exten_custom.conf but without success.
Can someone help me with this case ?

I solved the issue :slight_smile:
my mistake was that I used the wrong context. Just to share if you want to forward incoming calls to another PBX as dialing internal number in PBX2 you needs of:

  1. Trunk between PBX1 <-> PBX2
  2. Inbound route to match the incomming DID
  3. Outbound route to match the dest. number. I use 999|1XXX
  4. I used custom destination to transfer a call and dial a PBX2 number like
    custom destination [to-PBX2] “from-internal,9991001,1” =>
    -> 01221 -> inbound sip trunk -> [to-PBX2],dial"1000" <-IAX2->PBX2->ringing"1001"
    please, close the case
    Cheers,