Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTMF "onCallDTMFReceived" and "OnInfo" event not working #1064

Open
ElectronMB opened this issue Dec 5, 2023 · 6 comments
Open

DTMF "onCallDTMFReceived" and "OnInfo" event not working #1064

ElectronMB opened this issue Dec 5, 2023 · 6 comments

Comments

@ElectronMB
Copy link

Describe the bug

When two users are connected with an audio call, after that user 2 types any key from the keypad then I want to handle that key event on user 1 side whatever user 2 types like "1" or "#".
For the above case, I make logic like that.

1) on the keypad button click:

  const onKeyPadButtonClick = (number: string) => {
        const options = {
          requestOptions: {
            body: {
              contentDisposition: 'render',
              contentType: 'application/dtmf-relay',
              content: `Signal=${number}\r\nDuration=100`,
            },
          },
        };
        simpleUserRef.current?.session?.info(options);   
  };

2) to handle an event of DTMF tone and event:

useEffect(() => {
    if (simpleUserRef.current) {
      simpleUserRef.current.delegate = {
        onInfo: (info: any) => {
          console.log('Info,,,,,', info);
        },
        onCallDTMFReceived: (dtmf: any, duration: any) => {
          console.log('onCallDTMFReceived', dtmf, duration);
        },
      };
      if (simpleUserRef.current.session) {
        simpleUserRef.current.session.delegate = {
          onRefer: (dtmf: any, tone: any, duration: any) => {
            console.log('onRefer', dtmf, tone, duration);
          },
          onInfo: (info: any) => {
            console.log('Info,,,,,', info);
          },
        };
      }
    }
  }, []);

Note: In the above case I used SimpleUser to setup the sip.js connection.

Bug :

I didn't get anything in the above "onInfo" and "onCallDTMFReceived" event listener so how can I get it?

I want to handle the DTMF to another side of to one connection.

Expected behavior
as per the expected behavior, all the logs are displayed whenever some user press any key from the keypad.

Observed behavior
I didn't get anything in the above "onInfo" and "onCallDTMFReceived" event listener so how can I get it?

Environment Information

  • sip.js --> 0.21.2
  • Chrome: Version 119.0.6045.200 (Official Build) (64-bit)
@thebium
Copy link

thebium commented Dec 6, 2023

I've also have been testing receiving DTMF INFO messages. I can send DTMF and can see in console that it is sent and accepted by PBX system. If the DTMF is sent from mobile phone to the WebPhone then I don't see any INFO messages on the console, that it was received.

sip.js --> 0.21.2
Chrome: Version 119.0.6045.202 (Official Build) (64-bit)
PBX Server: Asterisk

@ElectronMB
Copy link
Author

I've also seen a log that DTMF sends successfully, but I didn't get anything in the above "onInfo" and "onCallDTMFReceived" event listener so, how can I get it?

I am trying to call webphone to another webphone.

@thebium
Copy link

thebium commented Dec 7, 2023

We managed to figure out what was the problem. sip.js can only handle SIP INFO message DTMF messages. Our webphone was setup to handle only RFC2833 DTMF messages and that's why sip.js did not see them.

@ElectronMB
Copy link
Author

Okay, so how can I get that dial keypad DTMF do you have a solution for that please share it so I can implement it.

you said the RFC2833 DTMF message is handle by webphone so how can I do this into project?

@thebium
Copy link

thebium commented Dec 7, 2023

I said that sip.js does not handle RFC2833 DTMF messages and you should configure your PBX extension for Webphone to handle SIP INFO DTMF messages.

@ElectronMB
Copy link
Author

Okay, Can you please share a reference on how we can configure in PBX extension?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants