Blocking all extensions except for one

on one phone (just say 2065) i want that extension to be able only to dial one phone just say (2066) and no one else…
how would i do that

thanks
joe

Set the phone up in its own context where that is the only number they can dial.

sorry…can you give me and example

and what file i modify

thanks

In sip.conf for the peer.
[2065]
context=only2066

Then in extensions.conf

[only2066]
exten => 2066,1,Dial(SIP/2066)
exten => i,1,Playback(pbx-invalid)

[2065]
context=only2066

can 2065 be part of two context…if so what would be the correct format

context=only2066;only2000

or no

thanks
again

You can include contexts within another. May want to look in the Asterisk book to see more examples of how this works so you have a better understanding.