How long does it take to get a mobile phone back from investigation?

My mobile phone was taken into police custody on 7th Sep 2017 after keeping me in lockup for a night on the evening of 6th Sep. Today its 26th Oct and I still haven't got it back. It happened because a case was filed against me by my ex friends girlfriend for slandering her on Facebook.. I have never met the girl before. I only knew her boyfriend who was my friend until this happened. I did it because she sent me messages full of bad words on facebook and instagram. I produced the proof but the sub inspector gave me the excuse of her being a girl and coming to complaint first. I got a call on 24th Oct saying I have to come and pick up a letter for me from the ACP. When I went I was told to visit the ACP's office so I did. Once there a person in civil dress told me I would have to get a female as a guarantor for me who should be living near me and should not be related to me. I was told to also come every Thursday to the ACP's office for "hajiri". Can anyone please advise me here on what I should do?