How to give a command to stop monitor call

hello, Guys:
I now, am using monitor() to record the calls. but i have check all commands, there is no command to let the dialplan to execute stopmonitor(). only when calls hangup, the this command will be executed. i have tried using AGI, no result. now i want to control the calls duration. i just monitor the call for first five minites and after then, i stop monitoring the calls. but the converition is still going on. if any knows this, please give me a hand. thanks!