Discretionary can only be granted if you are within the UK.
Discretionary leave to Remain will be granted to the people who are able to prove to the Home Office that their compelling on compassionate grounds and home office can consider the circumstances outside the Immigration Rules and exercise their discretionary powers.
Initially, it will be granted for 30 months but you can only apply for permanent residency only after you have completed 10 years, but if you were granted discretionary leave before 9 July 2012 then you can apply for Indefinite leave to Remain from Discretionary leave after 6 years.
It will always better to obtain Solicitors advice before you proceed.
Our Immigration Solicitors are expert to deal with discretionary leave to remain application.