Adds fireCallEvent by CallEvent, so it can be overridden and a custom CallEvent to be used.

deb-src-release-2.8.5426
Damian Minkov 11 years ago
parent 8fb59e2b95
commit e25de57217

@ -291,12 +291,12 @@ protected void processExtraHeaders(javax.sip.message.Message message)
logger.warn("Error getting media types", t);
}
getParentOperationSet().fireCallEvent(
incomingCall
? CallEvent.CALL_RECEIVED
: CallEvent.CALL_INITIATED,
this,
mediaDirections);
fireCallEvent(
incomingCall
? CallEvent.CALL_RECEIVED
: CallEvent.CALL_INITIATED,
this,
mediaDirections);
if(hasZrtp)
{
@ -313,6 +313,24 @@ protected void processExtraHeaders(javax.sip.message.Message message)
return callPeer;
}
/**
* Creates and dispatches a <tt>CallEvent</tt> notifying registered
* listeners that an event with id <tt>eventID</tt> has occurred on
* <tt>sourceCall</tt>.
*
* @param eventID the ID of the event to dispatch
* @param sourceCall the call on which the event has occurred.
* @param mediaDirections direction map for media types
*/
protected void fireCallEvent(
int eventID,
Call sourceCall,
Map<MediaType, MediaDirection> mediaDirections)
{
getParentOperationSet().fireCallEvent(
eventID, sourceCall, mediaDirections);
}
/**
* Returns the call peer whose associated jain sip dialog matches
* <tt>dialog</tt>.

@ -152,7 +152,18 @@ public void fireCallEvent(
Call sourceCall,
Map<MediaType, MediaDirection> mediaDirections)
{
CallEvent event = new CallEvent(sourceCall, eventID, mediaDirections);
fireCallEvent(new CallEvent(sourceCall, eventID, mediaDirections));
}
/**
* Creates and dispatches a <tt>CallEvent</tt> notifying registered
* listeners that an event with id <tt>eventID</tt> has occurred on
* <tt>sourceCall</tt>.
*
* @param event the event to dispatch
*/
public void fireCallEvent(CallEvent event)
{
List<CallListener> listeners;
synchronized (callListeners)
@ -176,7 +187,7 @@ public void fireCallEvent(
"Dispatching a CallEvent to "
+ listener.getClass() + " . The event is: "+ event);
switch (eventID)
switch (event.getEventID())
{
case CallEvent.CALL_INITIATED:
listener.outgoingCallCreated(event);

Loading…
Cancel
Save