Mourad Karoui:
so i tried to implement an "rtp audio stack" like you said, but i didn't know how.
As far as I remember your call automatically hangs up after 10 seconds of absence of RTP stream, so single ring is not the case. It should be something else like absence of media registering. In my project where CTI Ports send calls here and there I has more than enough time to put calls on hold yet not implementing rtp streams.
You have to register your CTI Port media capabilities though. I do it like this:
CiscoMediaCapability [] caps = new CiscoMediaCapability [1];
caps[0] = CiscoMediaCapability.G711_64K_30_MILLISECONDS;
((CiscoMediaTerminal)phone_term).register(myAddress, startPort, caps);
You will receive two events for each media stream in connected call: CiscoRTPInputStartedEv, CiscoRTPOutputStartedEv
You will receive two events for each disconnected media stream: CiscoRTPOutputStoppedEv, CiscoRTPInputStoppedEv
To get them your observer should implement CiscoTerminalObserver interface along with other observing interfaces.
Please make sure you get them at/after Established event occures to proceed with RTP streaming.
Here is the sample I used in testing of output medai stream. It plays raw wav file (G711 raw stream) repeatedly in portions of 20 milliseconds (it works with previously mentioned registration parameters). Receiver just eats everything coming to UDP port.