Dial command doesn't work in freepbx jail

I set up freepbx and asterisk in a jail listening to port 7070 (specified in sip.conf).
In my AGI script I do :

my $dialstring = “SIP/my-trunk/123”;
$res = $AGI->exec(“DIAL $dialstring”);

I set up my-trunk via the freepbx web interface. When I route a call through this dialcommand I get :

– Launched AGI Script /var/lib/asterisk/agi-bin/agicall.agi
– AGI Script Executing Application: (DIAL) Options: (SIP/my-trunk/123)
[Nov 2 01:02:51] WARNING[7377]: chan_sip.c:2860 create_addr: No such host: my-trunk
[Nov 2 01:02:51] WARNING[7377]: app_dial.c:1106 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 3 - No route to destination)

If I set up freepbx and asterisk in jail listening to port 5060 everything runs fine. Any clue ?