Restrict the SIP users

Is there a way to restrict the users based on the useragent of the SIP phone?
Thank you.

  1. You can set the different phones in to different context’s. For example phones 10,11 and 12 belong to context A and in their dial plan they can only call to each other phones 13,14, and 15 can call in the country and 16,17 and 18 have unlimited access.
  2. You can can have all the phones in the same context and set up in the dial plan that if 10,11 or 12 are dialing then they can only dial X 13,14,15 can dial X and Y.

IMHO option 1 is the easier way to go.