devangbhagdev / rtmplite

Automatically exported from code.google.com/p/rtmplite
0 stars 0 forks source link

DTMF using RFC2833 not working with Asterisk #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
First reported by Sunimal Rathnayake sunimalr@gmail.com  on Jun 24, 2012.

---
I have developed a new Flash based SIP client which uses siprtmp gateway. It 
works fine. However DTMF is not working.
In the server i can see the following.

rtmp-sendDTMF 1
  sending payload '\x01\x80\x00\xc8'
rtmp-sendDTMF 3
  sending payload '\x03\x80\x00\xc8'
rtmp-sendDTMF 3
  sending payload '\x03\x80\x00\xc8'

But nothing happens. What is the issue with this? I'm using an Asterisk PBX.

---

p2p-sip uses rf2833 for DTMF, the first thing is to check it it's enabled in 
the file sip.conf (should be enabled by default)

I've seen some issues when DTMF digits are pressed too fast, some of them get 
lost in the wild...

I can point you two possible solutions toyour problem

1- Enable dtmfrelax in sip.conf

2- If the previous does not work, you could change rtmplite to use SIP INFO 
requests instead of sending DTMF tones, as the following:

def rtmp_sendDTMF(self, digit):
    if self.session and self.session.ua:
        ua = self.session.ua
        m = ua.createRequest('INFO')
         m['Content-Type'] = SIPHeader('application/dtmf-relay', 'Content-Type')
        m.body = 'Signal=' + digit + '\nDuration=160'
        ua.sendRequest(m)
    yield

Regards

---

Thanks for the reply.
I could not make rfc2833 work. So I migrated into SIPINFO.
If works perfectly.

Original issue reported on code.google.com by theinten...@gmail.com on 29 Jun 2012 at 8:49

GoogleCodeExporter commented 8 years ago
I have Asterisk 1.8, made ​​in sip.conf relaxdtfm=yes, tried dtmfmode=auto 
in extension. Does not work. How can I fix this problem?

Original comment by nvcen...@gmail.com on 26 Aug 2012 at 10:14

GoogleCodeExporter commented 8 years ago
I try change
    def rtmp_sendDTMF(self, digit):
        try:
            if _debug: print 'rtmp-sendDTMF', digit
            if self.media:
                messages = self.media.dtmf2rtp(digit)
                if self.session and self.media.session and messages is not None:
                    for payload, ts, marker, fmt in messages:
                        self.media.session.send(payload=payload, ts=ts, marker=marker, fmt=fmt)
        except:
            if _debug: print '  exception in rtmp_sendDTMF'; traceback.print_exc()
        yield
to
def rtmp_sendDTMF(self, digit):
    if self.session and self.session.ua:
        ua = self.session.ua
        m = ua.createRequest('INFO')
         m['Content-Type'] = SIPHeader('application/dtmf-relay', 'Content-Type')
        m.body = 'Signal=' + digit + '\nDuration=160'
        ua.sendRequest(m)
    yield
And start siprtmp, i have error in console "invalid command sendDTMF" when i 
press digits in flash phone.

Original comment by nvcen...@gmail.com on 29 Nov 2012 at 1:48

GoogleCodeExporter commented 8 years ago
Is the function indented correctly? Python is sensitive to indentation. Send us 
the complete file after modification and we will be able to point out the 
mistake.

I noticed that your m['Content-Type'] line is not indented correctly.

The error is when onCommand cannot recognize rtmp_sendDTMF as a method in the 
Context class. This could be if the function is not indented correctly within 
the class.

Original comment by theinten...@gmail.com on 11 Jan 2013 at 7:26