How to force hangup current call when an extension start a new call

Hello, i need to be able to hangup a call if user start a new call. The problem is for example using the softphone when an user start a new call (using the “callto” link from the browser) it open a new sip line but keeps also the previous call active. So, basically what i want is to force hangup the previous call and then start a new one. Maybe it’s possible using the dialplan, any idea?. Thanks!