Some questions regarding the local channel and originateActi

Some questions regarding the local channel and originateAction

I am making a application based on Java. The purpus of this application is to initiate two calls from Asterisk. The implementation likes the follow:

+ A_number // one telephone number
+ “@CHANNEL1”);
originateAction.setExten(B_number); // the other telephone number

originateAction.setPriority(new Integer(1));
originateResponse = this.asteriskConnection.sendAction(originateAction,

I set the local channel like this:
; sip.conf

host= ”sip provider address”
fromdomain=”sip provider address”

And in the “extensions.conf“ I write the local channel like this:
; extension.conf

; there are two testing sip agents, which are 1000 and 1001 set in the sip.conf,
; the code below just hard code the dialplan of 1000 and 1001.
exten => 1000,1,Dial(SIP/1000)
exten => 1000,n,Hangup()
exten => 1001,1,Dial(SIP/1001)
exten => 1001,n,Hangup()
; code below is trying to match numbers more than six digits and Dial the number with the [SIPOUT1] account.

exten => _XXXXX.,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN:0} through OUT1)
exten => _XXXXX.,n,Dial(SIP/SIPOUT1/${EXTEN:0},60)
exten => _XXXXX.,n,congestion()
exten => _XXXXX.,n,Hangup()

; moreover, we have two local channel set like this

exten => _XXX.,1,DumpChan() ; context used for inbound calls
exten => _XXX.,2, NoOp(call back auth.)
exten => _XXX.,3,Goto(OUT1,${EXTEN},1)

exten => _XXX.,1,DumpChan() ; context used for outbound calls
exten => _XXX.,2,Goto(OUT1,${EXTEN},1)

So, theoretically, this way should work, run the code, Asterisk should bridge the [CHANNEL1] and [CHANNEL2] together. BUT it does not work as I expect currently.
If both “A_number“ and “B_number“= 1000 or 1001, which is the internal sip agent set for testing. The whole structure works perfectly.
If “A_number” = 1000 or 1001 and “B_number“ some other PSTN number. The whole structure works perfectly as well.
BUT, as long as set “A_number“ to a some other PSTN number, the whole system stop working. Base on the console from Java IDE. The Asterisk is trying to call the “A_number“ but the Asterisk cannot make it…

I am wondering if someone have idea about this problem I met. Thank you very much.

if I chose the proper place post this message…
I appreciate someone’s help…

what appears on the CLI ?