in reply to detemining the calling pakage

I couldn't understand your question clearly.You explain with sample example.It will be better for me to answer.