support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: December 21 2007 at 9:09am | IP Logged
|
|
|
Hi zhuyin,
The SipOutgoingCallInitializing immediate event will be sent to the app as the first “outgoing call related” event when you make a call. It will be sent to your app before the SipSendInvite phone line event.
The SipOutgoingCallInitializing event gives you a chance to easily add whatever “instance data” to the SIP INVITE that will be transmitted for the call. There are also other ways to add data to the INVITE SIP message such as directly modifying the INVITE before it gets transmitted (see the SipModifySipMessage immediate event).
The best way to get to know what events occur and in what order is to use the EventLogD.exe server utility that comes with the product. Start the EventLogD console app “server” and have it wait for events. Then have your app configure the media engine on startup to send events to the remote event log server.
For example, here is an event log capture using a soft phone based on the media engine. The soft phone directly called itself and then hung up. Here are the events the EventLogD server recorded (in real time):
Code:
IMMEDIATE_NOTIFICATION, Phone Line 0, SipOutgoingCallInitializing
PHONE_LINE_NOTIFICATION, Phone Line 0: SipOutgoingCallStart
PHONE_LINE_NOTIFICATION, Phone Line 0: SipDialTone
PHONE_LINE_NOTIFICATION, Phone Line 0: SipDialing
PHONE_LINE_NOTIFICATION, Phone Line 0: SipSendInvite
IMMEDIATE_NOTIFICATION, Phone Line 0, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 0: SipStartOutgoingRing
IMMEDIATE_NOTIFICATION, SipModifySipMessage
IMMEDIATE_NOTIFICATION, SipModifySipMessage
IMMEDIATE_NOTIFICATION, SipIncomingAuthentication
IMMEDIATE_NOTIFICATION, SipIncomingCallAssignPhoneLine
PHONE_LINE_NOTIFICATION, Phone Line 1: SipIncomingCallStart
IMMEDIATE_NOTIFICATION, Phone Line 1, SipIncomingCallInitialized
PHONE_LINE_NOTIFICATION, Phone Line 1: SipSendTrying
IMMEDIATE_NOTIFICATION, Phone Line 1, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 1: SipSendRinging
IMMEDIATE_NOTIFICATION, Phone Line 1, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 1: SipStartIncomingRing
PHONE_LINE_NOTIFICATION, Phone Line 1: SipOkToAnswerCall
PHONE_LINE_NOTIFICATION, Phone Line 0: SipReceivedProvisionalResponse
PHONE_LINE_NOTIFICATION, Phone Line 0: SipReceived100Trying
PHONE_LINE_NOTIFICATION, Phone Line 0: SipWaitForInviteOk
IMMEDIATE_NOTIFICATION, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 0: SipReceived180Ringing
PHONE_LINE_NOTIFICATION, Phone Line 1: SipAnsweringCall
PHONE_LINE_NOTIFICATION, Phone Line 1: SipSend200Ok
IMMEDIATE_NOTIFICATION, Phone Line 1, SipModifySipMessage
IMMEDIATE_NOTIFICATION, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 0: SipInviteOkReceived
PHONE_LINE_NOTIFICATION, Phone Line 0: SipSendInviteAck
IMMEDIATE_NOTIFICATION, Phone Line 0, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 0: SipOutgoingCallConnected
PHONE_LINE_NOTIFICATION, Phone Line 0: SipInCall
IMMEDIATE_NOTIFICATION, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 1: SipReceivedInviteAck
PHONE_LINE_NOTIFICATION, Phone Line 1: SipIncomingCallConnected
PHONE_LINE_NOTIFICATION, Phone Line 1: SipInCall
PHONE_LINE_NOTIFICATION, Phone Line 0: SipSendBye
IMMEDIATE_NOTIFICATION, Phone Line 0, SipModifySipMessage
IMMEDIATE_NOTIFICATION, SipModifySipMessage
IMMEDIATE_NOTIFICATION, SipIncomingAuthentication
PHONE_LINE_NOTIFICATION, Phone Line 1: SipByeReceived
IMMEDIATE_NOTIFICATION, Phone Line 1, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 1: SipSendByeAck
PHONE_LINE_NOTIFICATION, Phone Line 1: SipCallComplete
PHONE_LINE_NOTIFICATION, Phone Line 1: SipOnHook
IMMEDIATE_NOTIFICATION, SipModifySipMessage
PHONE_LINE_NOTIFICATION, Phone Line 0: SipReceivedByeAck
PHONE_LINE_NOTIFICATION, Phone Line 0: SipCallComplete
PHONE_LINE_NOTIFICATION, Phone Line 0: SipOnHook
|
|
|
The above events are the exact same events that are sent to the VOIP application – in this case, our 2 line soft phone.
So the moral of the story is this: When learning the behavior of the media engine events, use the EventLogD.exe server and you will see exactly what events are being sent to your application and in what order. Once you see the events that are sent to your application, you can then look them up in the Software Developer’s Reference and see if your application should process those events. That’s how we do it here.
Additional Info:
You and others may need additional info regarding events so we will give a brief overview of events now:
There are actually three different classes of media engine events that can be sent to your VOIP application.
Immediate Events:
These events are sent to your application when the media engine needs application input. In other words, the media engine fires an immediate event to the app and the app must instruct the media engine how to proceed with whatever task the media engine I trying to perform. The media engine generally passes to the app some form of data structure that the app must modify. How the app modified the passed (immediate) data structure determines what action the media engine will perform for its immediate operation. VOIP apps must process immediate event as fast as possible in order to not hinder the fasted possible call processing capabilities of the media engine. These events may or may not be associated with a particular phone line/call. These immediate events must be processed in the main media engine call back handler your application specifies on media engine start-up. For more info, see the “Immediate Telephony Events” section of the Software Developer’s Reference.
Global Events:
These events are used to notify applications of telephony engine status that is not specific to any of the supported phone lines. These events can be passed to another thread in your application for deferred processing. Doing so will allow the media engine to continue to process calls as fast as possible. For more info, see the “Global Telephony Events” section of the Software Developer’s Reference.
Phone Line Events:
These events are phone line specific and are sent to your application to indicate phone line state changes. These events can be passed to another thread in your application for deferred processing. Doing so will allow the media engine to continue to process calls as fast as possible. For more info, see the “Phone Line Telephony Events” section of the Software Developer’s Reference.
As we mentioned earlier, the best way to learn about events is to use the EventLogD.exe server utility that comes with the VOIP Media Engine. Below is a screen shot of the 2 line test soft phone and the EventLogD server utility.
Support
|