We are trying to prevent notifications from a certain event domain from being read to users on the phone. I created a bit of Action Script for callout / callin to retrieve the notification list and remove the notifications that are not to be read from the list. In testing callin, the line of code to get the intiating event is either not being executed or failing, and the phone makes a clicking sound and disconnects.
Here is the code I added (after $notificationIds = @session::getNotifications()) :
### Start - Adding code for Stopping MOCA alerts being read out via Phone Interface
IF (! empty($notificationIds) )
$notIdRef = $notificationIds::size()
@script::log("Processing notifications; found: " & $notIdRef)
$notIdRef = $notIdRef - 1
while ($notIdRef >= 0)
$notID = $notificationIds::get($notIdRef)
@script::log("Processing notification ID(" & $notIdRef & "): " & $notID)
@interaction::retrieveInteractionContext($notID)
@script::log("Got Here 1")
@initiatingEvent = @interaction::getInitiatingEvent()
@script::log("Got Here 2")
@script::log("Discarding phone call notification for MoCA event: " & $initiatingEvent.domain)
IF ($initiatingEvent.domain == "hpsmchange")
@script::log("Discarding phone call notification for MoCA event: " & $initiatingEvent.id)
$notificationIds::remove($notIdRef)
ENDIF
$notIdRef = $notIdRef - 1
endwhile
ENDIF
Here is the output in the log:
2013-07-02 11:01:18,592 [pool-PSTN-thread-5] INFO - Starting Callin Script
2013-07-02 11:01:36,423 [pool-PSTN-thread-5] INFO - Processing notifications; found: 3
2013-07-02 11:01:36,423 [pool-PSTN-thread-5] INFO - Processing notification ID(2): 46911059
2013-07-02 11:01:36,595 [pool-PSTN-thread-5] INFO - Got Here 1