Hi,
I was trying to setup a monitor to a VDN , but for some reason i can't get the delivered event to trigger.
The code itself runs fine, i just can't seem to trigger the event
I hope someone can help me figure this out :-)
Below is the powershell code and the xml responses received (i did edit out the details from the extension and the switchname):
#Add the serviceprovider dll
Add-Type -Path "C:\temp\ServiceProvider.dll"
#region Functions
function Get-DeliveredEvent
{
[cmdletbinding()]
param (
[Avaya.ApplicationEnablement.DMCC.ServiceProvider]$provider
)
[array]$global:eventhandler += [xml]$provider.getlastincomingxmlmessage()
}
#endregion Functions
#Create a new object for the serviceprovider
$provider = New-Object Avaya.ApplicationEnablement.DMCC.ServiceProvider
#Start the applicationsession to AES
$provider.StartApplicationSession($aesip, $port, $applicationname, $user, $password, "5", "180", "http://www.ecma-international.org/standards/ecma-323/csta/ed3/privD", $false, $null, $true, $true, $null)
#Create a new device object to store the device details
$ownerDevice = $provider.Getnewdevice()
#Retrieve the device id from AES
$ownerDevice.GetDeviceId($extension, $switchname, $null, $true, $ownerDevice)
#Generate the events object
$Events = [avaya.ApplicationEnablement.DMCC.ThirdPartyCallController+ThirdPartyCallsViaDeviceCallControlEvents]($false)
#Enable the required events that need to be monitored from the VDN
$events.DeliveredEvent = $true
#Add an ondeliveredevent to store the XML message
$provider.getThirdPartyCallController.add_OnDeliveredEvent({Get-DeliveredEvent})
#Start monitoring the VDN
$provider.getThirdPartyCallController.StartMonitor($ownerDevice.getDeviceIdAsString, $Events, $null)
Start session response:
<?xml version="1.0" encoding="UTF-8"?>
<StartApplicationSessionPosResponse xmlns="http://www.ecma-international.org/standards/ecma-354/appl_session"><sessionID>BF133C190108AA7E53615FBB7962A094-1587</sessionID><actualPro
tocolVersion>http://www.ecma-international.org/standards/ecma-323/csta/ed3/privD</actualProtocolVersion><actualSessionDuration>180</actualSessionDuration></StartApplicationSessionP
osResponse>
GetdeviceID response
<?xml version="1.0" encoding="UTF-8"?>
<GetDeviceIdResponse xmlns="http://www.avaya.com/csta"><device typeOfNumber="other" mediaClass="voice" bitRate="constant">EXTENSION:SWITCHNAME:0.0.0.0:0</device></GetDeviceIdResponse>
Startmonitor response:
<?xml version="1.0" encoding="UTF-8"?>
<MonitorStartResponse xmlns="http://www.ecma-international.org/standards/ecma-323/csta/ed3"><monitorCrossRefID>2253</monitorCrossRefID><actualMonitorFilter><callcontrol><callCleare
d>false</callCleared><conferenced>false</conferenced><connectionCleared>false</connectionCleared><delivered>true</delivered><diverted>false</diverted><established>false</establishe
d><failed>false</failed><held>false</held><networkReached>false</networkReached><originated>false</originated><queued>false</queued><retrieved>false</retrieved><serviceInitiated>fa
lse</serviceInitiated><transferred>false</transferred></callcontrol><logicalDeviceFeature><agentNotReady>false</agentNotReady><agentReady>false</agentReady><agentWorkingAfterCall>f
alse</agentWorkingAfterCall></logicalDeviceFeature></actualMonitorFilter><extensions><privateData><private><ns1:AvayaEvents xmlns:ns1="http://www.avaya.com/csta" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:AvayaEvents"><ns1:invertFilter>true</ns1:invertFilter><ns1:callControlPrivate><ns1:enteredDigits>false</ns1:enteredDigits></ns1:ca
llControlPrivate></ns1:AvayaEvents></private></privateData></extensions></MonitorStartResponse>