I want to create a script in which if a http request is being executed e.g, I have played a voicefile using a http operation Play() defined in my code. In the mean time when the file is getting played , i want Pause() Operation to be called which can pause the file being played.
The problem I am facing is that, As the HTTP request for PLAY is getting hit, the script gets back the control only after the successful/failure execution of PLAY() i.e. when the complete play operation has been completed due to which my pause operation returns failure because there isn't any file which is getting played currently.
I can't use 2 scripts because both use the same data (Call-ID)
Any help on this would be highly Appreciated.
Thanks in Advance.
More detail would be helpful. What information does a thread need before it can construct a valid pause request? Could the thread that sends the play request write this information into some module-level data structure? Then the thread that is doing the pause could read this information and build a valid request.