I have realized that my dial plan does not stop if the user hangs up the call, at least no immediately. and I have a loop that is going for 100 times it will go through the 100s loop even if the user actually hang up. is there a way to make the daily plan stop if the call is hangup?
In that case you need to talk to you SIP provider. Asterisk will hang up if it receives a SIP BYE. If that is not happening, the provider is presumably failing to handle disconnect supervision properly.
verbose 3 and the protocol logs from your SIP channel driver should help clarify what is really happening.