Enabling security on IAX2 trunks

I am presently using iax2 trunking to connect 2 offices:
Below is the peer settings

allow=gsm&alaw&ulaw
context=from-internal
deny=all
host=XXX.XXX.XXX.XXX
qualify=yes
trunk=yes
type=friend

My question is how do i enable security on the IAX2 trunks? It seems that anyone with the ip will be able to log on to the servers.Any help is appreciated.

adding the following lines:

auth=md5
secret=mysecretpassword

tightens things up considerably.

host=your other box ipaddress

Also, context=from-trunk or context=from-pstn makes it so incoming calls on that trunk can’t go out the local lines on the box (other trunks you may have).