Author |
|
speedvoip Vetran
Joined: August 07 2008 Location: Canada Posts: 156
|
Posted: November 18 2008 at 1:25am | IP Logged
|
|
|
Hi Support:
I have known that early media for 183 response which requests open media channel for playback audio such as color ring etc. is not available within media engine. Then I want to know how to implement it at my VoIP application? In fact, when app detects 183 received event and at its callback opens media channel, that's ok, isn't it?
If current this feature is not at list, I think media engine should provide means to allow app to implement feature.
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: November 19 2008 at 9:37am | IP Logged
|
|
|
Hi George,
You >>>
I have known that early media for 183 response which requests open media channel for playback audio such as color ring etc. is not available within media engine. Then I want to know how to implement it at my VoIP application?
<<< Support
OK. The information I am going to talk about now is completely off the top of my head. Hopefully there will be no inaccuracies in what I am going to say.
Theoretically, you could support early media at the application level but we don’t advise it. Also, it would be somewhat of a hack.
Note that if you chose to go this route before we get the chance to add early media to the media engine, they your app will have to manage all the RTP reception issue that are typical of VOIP (RTP packet sequence errors, missing packets, packet loss concealment, format/rate conversion of RTP media so that the early media can be played back to the soft phone user via the media engine’s software audio outputs, etc). For this explanation, we assume the early media SDP is contained in a received 183 Session Progress SIP message. Here is the recipe:
1)
The VOIP app would have to detect the start of call by temporarily saving the incoming INVITE request. Do this by processing the SipIncomingCallInitialized immedia event. The receive INVITE will be part of the INCOMING_CALL_INITIALIZED_DATA structure that gets passed to the app.
2)
The app will have to monitor all received SIP messages for the reception of “183 Session Progress” SIP messages. The app can filter all received SIP messages by processing the SipModifySipMessage immediate event. The app will have the received SIP message in the SIP_MESSAGE_IMMEDIATE_DATA structure that gets passed to the app.
3)
The app will then have to determine if a received “183 Session Progress” can be matched to any received INVITE. Do this by comparing the required SIP headers (CallId, From header Tag, etc).
4)
If the app matches the “183 Session Progress” to an INVITE and the 183 message contains early media SDP, the app must manually construct a valid SIP response using the INVITE and/or “183 Session Progress” message as needed. The app should then bind to an open UDP socket to get ready to receive early media RTP from the far end of the call. The app will be 100% responsible for managing the early received media RTP packets.
At this point, the app should also open a media engine software audio output for early media playback. See the OpenAudioOutChannel() API procedure to get started.
After the receive UDP socket is open, the app sends the appropriate “183 Session Progress” response. The far end of the call should then start sending early media.
5)
The App takes all received RTP media packets and performs whatever processing on them as needed (handle jitter, missing packets, etc). The app then must format/rate convert the RTP media from the RTP media type to the format/rate expected by the media engine’s audio output. This format/rate conversion can be handled by the app using individual format/rate conversion blocks supported by the media engine. See the CreateFormatRateConverter() API procedure to get started.
6)
The app then sends all converted early media audio to the media engine audio out channel. The user of your soft phone will then hear the early media. Note: If your soft phone user must respond to prompts via DTMF signaling, that is a whole other matter and we will comment on that later if required.
7)
The app will eventually have to detect if the call gets answered normally by the media engine or gets terminated. In ether case, the app will have to destroy the format/rate converter blocks it was using, close the audio output for playback, cloe the UDP socket it opened and recover any other memory it used for this capability.
If the call gets answered by the far end, the media engine will receive a “200 OK” response to the original INVITE request and the call will enter the SipInCall state. Your app should process the SipInCall event. If the call gets terminated, your app will receive the SipCallCanceled event. Your app should process the SipCallCanceled event.
These are the basics of what has to be done at the application level. Its much easier for you to wait until we natively support early media. If you can’t wait until we implement early media, we could add it to the media engine if your company wants to contract with us to add it immediately. We do understand the importance of supporting early media and will include it in the product.
You >>>
In fact, when app detects 183 received event and at its callback opens media channel, that's ok, isn't it?
<<< Support
Yes. This is correct.
You >>>
If current this feature is not at list, I think media engine should provide means to allow app to implement feature.
<<< Support
We agree. We are open for suggestions on how best to handle it.
Support
|
Back to Top |
|
|
speedvoip Vetran
Joined: August 07 2008 Location: Canada Posts: 156
|
Posted: November 19 2008 at 11:48am | IP Logged
|
|
|
Hi Support:
Very good on your technical remarks. I want ot know when to add early media feature into formal release?
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: November 19 2008 at 2:19pm | IP Logged
|
|
|
Hi George,
Not sure when we would add support for early media. I know this will not help but maybe we will add it sometime on 2009. Other feature requests will probably come first.
If you would like us to add this feature immediately, we can do it on a “custom software” contract basis. This means we would add the feature to the product but have to bill your company for the development and test time we incur. If you are interested, repost and we can discuss further off line.
Thanks,
Randal
|
Back to Top |
|
|
speedvoip Vetran
Joined: August 07 2008 Location: Canada Posts: 156
|
Posted: November 20 2008 at 3:30am | IP Logged
|
|
|
Hi Support:
We indeed need early media festure, pls address me price!
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: November 20 2008 at 7:48am | IP Logged
|
|
|
Hi George,
OK, I will send you via email the details on how we can proceed from here.
Randal
|
Back to Top |
|
|
|
|