[SIP Beyond VoIP] Debugging DTMF for conference bridge app

Jason Ostrom jpo at pobox.com
Sat Dec 21 19:09:45 CET 2013


I have done the following in order to have SIP Simple print out the DTMF, and it is still not working.

1.  Ported code from sip-session sample sipclients for DTMF receiving into other python script.  The code is listening for notification from the audio stream just as sip-session does.

2.  Verified that the DTMF is being received as RFC 2833 and it is broadcasted by Asterisk.  Ran a wireshark trace and all digits are being received on host running sip simple SDK apps.

Problem is SIP Simple code is not able to detect DTMF, or at least my implementation.

Question:  How do I get the "sip-session" sample application to receive DTMF and print out each DTMF digit to stdout?  Does it do this by default?  How do I debug / print each RTP packet, because DTMF in RTP Payload is not detected?  I am trying to troubleshoot it, if I can just get sip-session to print each DTMF digit that is broadcasted by another conference user, then I can get the 'sip-session' DTMF receiving code working in the other python script.  Both scripts are successfully dialing into conference.  Other conference user inputs DTMF, and I can see Asterisk broadcasting, but nothing on receiving scripts.  Please let me know if any ideas.

Using SIP Simple 1.0.0.

Jason

On Dec 20, 2013, at 6:36 AM, Saúl Ibarra Corretgé <saul at ag-projects.com> wrote:

> 
> On Dec 19, 2013, at 7:43 PM, Jason Ostrom wrote:
> 
>> Hi,
>> 
>> I have a python script (https://code.google.com/p/moshimoshi/) using SIP Simple that is dialing into an Asterisk server conference bridge using new confbridge module.  The python script is supposed to wait/listen for DTMF tones and when DTMF is input by another conference user, the script should take action based on DTMF.
>> 
>> The script does not appear to receive or process DTMF and I believe that DTMF pass through/broadcast/ relay is configured on Asterisk.  Asterisk logger.c shows that DTMF is getting processed.  Can you help me debug why this isn't working in SIP Simple python script?  
>> 
>> Code snippet:
>> "
>> def _NH_AudioStreamGotDTMF(self, notification):
>>               digit = notification.data.digit
>>               print 'Got DMTF %s ' % notification.data.digit
>>               self.dtmf_buffer += digit
>>               # '*' equal EOL
>>               if (digit == '*'):
>> 
>>                       print "Processing %s" % self.dtmf_buffer
>> 
>>                       # '0#*' eq Launching a pre-define application
>> 
>>                       if (self.dtmf_buffer.startswith("0#") == True):
>>                               print "Launching xeyes ..."
>>                               os.system('xeyes &')
>> "
>> 
> 
> The notification handler looks correct, but you need to be listening for notification from the audio stream to receive it. Also note that only RFC2833 based DTMFs are supported, if your Asterisk is using SIP INFO requests it's not going to work.
> 
> 
> Regards,
> 
> --
> Saúl Ibarra Corretgé
> AG Projects
> 
> 
> 



More information about the SIPBeyondVoIP mailing list