cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2462
Views
0
Helpful
14
Replies

DTMF input in finesse10.5(1)

ajey_shetty
Level 1
Level 1

I am trying the below code to send DTMF, But I am getting an error "Cannot read the property 'sendDTMFRequest' of undefined ". I am new to this and not sure what I am doing wrong. Please help.

 

sendDTMFRequest: function(digit){
            dialog.sendDTMFRequest(user.getExtension(), {
                success: SSTSuccess,
                error: SSTError
            },digit);
 
/**
     * Handler for DTMFRequest when successful
     */
    SSTSuccess = function(rsp) {

        clientLogs.log("DTMF is Success");
    
    },
    
       
    
    /**
     * Handler for DTMFRequest when error occurs.
     */
    SSTError = function(rsp) {
    
            clientLogs.log"DTMF has failed");
    
    
    },
 
 
1 Accepted Solution

Accepted Solutions

Hi,

 

In the code you pasted, I don't ever see the dialog object being instantiated. You need to get the dialog object first before you call one of its methods. 

 

User is ok because it is instantiated. Take a look at the call recording sample gadget to get an idea on how to use the dialog object in the return block: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/CallRecordingSampleGadget

 

Thanx,

Denise

View solution in original post

14 Replies 14

dekwan
Cisco Employee
Cisco Employee

Hi,

 

Most likely, the dialog object that you are calling sendDTMFRequest from is not defined. Where is that object coming from?

 

Thanx,

Denise

I am sorry, I am new to this. How do i define dilog object ?

 

Hi,

 

Take a look at the learning sample gadget: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/LearningSampleGadget

 

It teaches you how to use the user and dialog object.

 

Thanx,

Denise

 

Hi,

 

In the code you pasted, I don't ever see the dialog object being instantiated. You need to get the dialog object first before you call one of its methods. 

 

User is ok because it is instantiated. Take a look at the call recording sample gadget to get an idea on how to use the dialog object in the return block: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/CallRecordingSampleGadget

 

Thanx,

Denise

Working. Thank you so much !!! :)

You're welcome. Glad I was able to help.

I tried to replicate the call recording just with send dtmf, but keep getting 400 Bad request.
Is this right?

sendDTMFRequest : function () {
_clientLogger.log ("sendDTMFRequest(): in method");

if (_dialog === null) {
_clientLogger.log("sendDTMFRequest(): No Dialog to Send Dtmf on.");
return;
}

_clientLogger.log("sendDTMFRequest(): Sending Dtmf on Dialog: " + _dialog.getId());

_dialog.requestAction(_user.getExtension(),
finesse.restservices.Dialog.Actions.DTMF,
{
success : _DtmfSuccess,
error : _DtmfError
},"1234");

Regards,

Dhillip A

How was this resolved i was trying to do the same thing.Thanks in advance.

 

Regards,

 

Dhillip A

Hi,

 

To send DTMF, you must use the sendDTMFRequest(mediaAddress, handlers, digit) method: https://pubhub.devnetcloud.com/media/finesse/docs/guides/javascript-library/symbols/finesse.restservices.Dialog.html#sendDTMFRequest instead of the requestAction.

 

Thanx,

Denise

Denise,

 

Thanks, yes was able to get this going with SendDTMFRequest method over the weekend. issue is with with handling the dialog.

 

Regards,

 

Dhillip A

Hi,

 

Can you be more specific when you say "issue is with with handling the dialog." Is the request successful? What error are you getting? Are you getting into the correct handler?

 

Thanx,

Denise

Hello Densie,

 

Sorry for delay, Yes the request is successful, i was getting uncaughtrefrence error. After looking into you example of i was able to get the request passed successfully.

 

_dialog.sendDTMFRequest(_user.getExtension(),
{
success : _DTMFSuccess,
error : _DTMFError
},'12345');

 

 

So the issue seems to be i was not handling the change dialog events properly.

 

Regards,

 

Dhillip A

Hi,

 

Great that you got it working!

 

Thanx,

Denise

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: