Connecting two asterisk server

Hi,

I have two freepbx servers and i was able to connect the two servers.

Scenario: Every calls to my 1st server was redirected to my 2nd server.

Problem: My problem is if i call the queues on my first server from 2nd server the calls are redirected again to second server.

How can i put condition on first server that if the calls come from second server no need to redirected it back to second server?

Here’s my peers detail on first server:
username=532
type=friend
secret=secrect
qualify=yes
nat=yes
insecure=very
host=192.168.10.115
dtmfmode=rfc2833
disallow=all
allow=g729&ulaw&alaw&gsm
context=from-trunk