Author Message
Khush
Joined: Jun 10, 2016
Messages: 55
Offline
I need to capture the out-of-band tones.
I declared the handlers for :

AddHandler ownerDevice.getPhone.getMedia.OnTonesRetrievedEvent, AddressOf ownerDevice_getPhone_OnTonesRetrievedEvent
AddHandler ownerDevice.getPhone.getMedia.OnStartToneCollectionResponse, AddressOf OnStartToneCollectionResponse

and for start monitor:
Dim MediaEvents As Avaya.ApplicationEnablement.DMCC.Media.MediaEvents
MediaEvents = New Avaya.ApplicationEnablement.DMCC.Media.MediaEvents(True)
MediaEvents.MediaStartedEvent = True
MediaEvents.MediaStoppedEvent = True
MediaEvents.TonesDetectedEvent = True
MediaEvents.TonesRetrievedEvent = True
ownerDevice.getPhone.getMedia.StartMonitor(MediaEvents, "Media")


I have defined the timeout and started the tone collector:
Dim timeOutInt As New Avaya.ApplicationEnablement.DMCC.Media.RetrievalCriteria
timeOutInt.InitialTimeout = 5

ownerDevice.getPhone.getMedia.SetToneRetrievalCriteria(timeOutInt, Nothing)
ownerDevice.getPhone.getMedia.StartToneCollection(Nothing)


But I am not able to get the tones. Help required.
Thanks
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
Have you registered the terminal in Server media mode or Client media mode?

Martin
Khush
Joined: Jun 10, 2016
Messages: 55
Offline
Yes, below is the complete code for the method:
Sub ownerDevice_OnGetDeviceIdResponse(ByVal sender As Object, ByVal e As Device.GetDeviceIdResponseArgs)
Try
If e.getError <> "" Then
MessageBox.Show("Did not get a Device ID.")
stopApplicationSession(APPLICATION_ERROR)
Return
End If

Dim PhoneMonitorEvents As Phone.PhoneEvents
PhoneMonitorEvents = New Phone.PhoneEvents(False)
' Configure the events in the monitor that we want to be notified about
PhoneMonitorEvents.DisplayUpdatedEvent = True
PhoneMonitorEvents.HookswitchEvent = True
PhoneMonitorEvents.LampModeEvent = True
PhoneMonitorEvents.RingerStatusEvent = True

' Start the monitor for the phone of the user who we want to record calls for.
ownerDevice.getPhone.StartMonitor(PhoneMonitorEvents, "Phone")

'AddHandler ownerDevice.getPhone.getMedia.OnMediaStartedEvent, AddressOf getMedia_OnMediaStartedEvent
'AddHandler ownerDevice.getPhone.getMedia.OnStartMonitorResponse, AddressOf Media_OnStartMonitorResponseMethod
AddHandler ownerDevice.getPhone.getMedia.OnToneDetectedEvent, AddressOf ownerDevice_getPhone_OnToneDetectedEventMethod
AddHandler ownerDevice.getPhone.getMedia.OnTonesRetrievedEvent, AddressOf ownerDevice_getPhone_OnTonesRetrievedEvent
AddHandler ownerDevice.getPhone.getMedia.OnStartToneCollectionResponse, AddressOf OnStartToneCollectionResponse

Dim MediaEvents As Avaya.ApplicationEnablement.DMCC.Media.MediaEvents
MediaEvents = New Avaya.ApplicationEnablement.DMCC.Media.MediaEvents(True)
MediaEvents.MediaStartedEvent = True
MediaEvents.MediaStoppedEvent = True
MediaEvents.TonesDetectedEvent = True
MediaEvents.TonesRetrievedEvent = True
ownerDevice.getPhone.getMedia.StartMonitor(MediaEvents, "Media")
Dim timeOutInt As New Avaya.ApplicationEnablement.DMCC.Media.RetrievalCriteria
timeOutInt.InitialTimeout = 5

ownerDevice.getPhone.getMedia.SetToneRetrievalCriteria(timeOutInt, ActiveCallCallId)
ownerDevice.getPhone.getMedia.StartToneCollection(ActiveCallCallId)


Dim loginInfo As Phone.LoginInfo
Dim mediaInfo As Phone.MediaInfo
loginInfo = New Phone.LoginInfo()
mediaInfo = New Phone.MediaInfo()
loginInfo.ExtensionPassword = password.Text
loginInfo.ForceLogin = True
mediaInfo.MediaControl = Media.MediaMode.CLIENT_MODE
ownerDevice.getPhone.RegisterTerminal(loginInfo, mediaInfo, extension.Text)

thirdpartyCalls()
Catch exc As Exception
' Should put in better error code here. For now, just show the user the exception.
MessageBox.Show(exc.Message)
stopApplicationSession(APPLICATION_ERROR)
End Try
End Sub
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
According to the hover-over help in the DMCC Dashboard, you must be using Server media mode to be able to use the Tone Collection service. I do vaguely remember something like that, but the programmers guides seem to imply that it works in Client media mode too.

Does your OnToneDetectedEvent callback get events?

Are the DTMF tones being transported In-band, Out-of-band or by payload?

Is this a station-station call, or is there a trunk in the call? What type of phones/trunks - H.323, SIP, ISDN/Digital or Analog?

Martin
Khush
Joined: Jun 10, 2016
Messages: 55
Offline
I used sever media mode, OUT_OF_Band

SIP trunk to SBC-> Session Manager-> AAEP-> Agent. Internally SIP tucking.
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
A few comments:

1. The timeouts in RetrievalCriteria are in mS so you will need to use much larger values if you want to use timeouts.

2. If you send the SetToneRetrievalCriteria() request before the call begins, it will probably timeout before any call is active. It is probably better to send SetToneRetrievalCriteria() after a call starts.

3. Once you get a TonesRetrievedEvent, you will need to send SetToneRetrievalCriteria() again, if you want to collect further tones. You might find this thread useful https://www.devconnectprogram.com/forums/posts/list/3670.page.

4. Beware using Server Media mode. In this case, media is sent to AE Services. This only supports a relatively small number of terminals. For large-scale deployments, you should use Client media mode. You can get more information on scaling in the AE Services Overview document.

5. To me, ToneCollection seems quite tricky to use. You may find it easier to use ToneDetected instead. If you were to change to Client media mode, you would need to use ToneDetected events.

Martin
Khush
Joined: Jun 10, 2016
Messages: 55
Offline
Hi Martin,

Appreciate your response!
Could you please provide some sample for tone Detection ?

thanks
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
I don't know of any .Net samples. However, the DMCC Java SDK includes a sample app called "tutorial" which you may find useful.

Martin
Go to:   
Mobile view