Real simple question

I want to run a php script when a call is ended, is there a specific place i need to put it to have it run automatically, or do i need to adjust a file to tell it to run when the call ends?

Take a look at the hangup extension (h) and the system command.