Asterisk=>Asterisk=>Outgoing

I want to do the following:

Asterisk 1 => Asterisk 2 => PSTN

I want to call the PSTN network from my Asterisk 1 box throught my second box.
The second already can call on the PSTN network.

I have made a SIP-trunk between the 2 boxes. But when I send a phone number to Asterisk2. It just call’s a ringgroup.

SIP configs:
Asterisk 1 (sip.conf):

[toRealServer]
host=172.27.10.1
username=userReal
fromuser=userReal
secret=userReal
type=peer
qualify=yes
context=from-trunk

[userTest]
secret=userTest
type=user
context=from-trunk

Asterisk2 (sip.conf):

[toTestServer]
host=10.20.1.15
username=userTest
fromuser=userTest
secret=userTest
type=peer
qualify=yes
context=from-trunk

[userReal]
secret=userReal
type=user
context=from-trunk

Asterisk 1 outbound route (extensions.conf):

[outrt-003-toRealServer]
include => outrt-003-toRealServer-custom
exten => _8.,1,Macro(user-callerid,SKIPTTL,)
exten => _8.,n,Set(_NODEST=)
exten => _8.,n,Macro(record-enable,${AMPUSER},OUT,)
exten => _8.,n,Macro(dialout-trunk,4,${EXTEN:1},,)
exten => _8.,n,Macro(outisbusy,)

; end of [outrt-003-toRealServer]

So when I dial 80496650182 on Asterisk1 it sends 0496650182 to asterisk2.

here is a piece of my call log on Asterisk1:

"","200","80496650182","from-internal","""user1"" <200>","SIP/100-000000ac","SIP/toRealServer-000000ad","Dial","SIP/toRealServer/0496650182,300,","2011-03-08 14:09:12","2011-03-08 14:09:21","2011-03-08 14:09:25",13,4,"ANSWERED","DOCUMENTATION","1299589752.441",""

here is a piece of my call reports on Asterisk2:

2011-03-08 16:26:58 	SIP/userRe... 	userReal 	"user1" <userReal> 	600 	ANSWERED 	00:10

So when I call it calls ringgroup 600 :frowning:
This is comming from a inbound route:
“ANY DID/ANY CID” => Call 600.
How can I make that it doesn’t do this?

already fixxed:

changed:

[userReal]
secret=userReal
type=user
context=from-trunk

to

[userReal]
secret=userReal
type=user
context=from-internal