Help creating SIP extensions

Hi there
I am trying to create some sort of a script for my SIP users on my A@home box

My goal is that I would be able to dynamic create users and then delete them again after a while.

I have another application where the users login, so they never connect direct to my box.

It could be something like … x&pass=ZZZ eg. … x&pass=ZZZ eg.

My I am very new at php, I really have no clue how to start.
Can someone help me out or point me in the right direction please.