linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-users] No dtmf generator when attempting to play dtmf [Python]


From: Kenneth Clive
Subject: [Linphone-users] No dtmf generator when attempting to play dtmf [Python]
Date: Wed, 16 Sep 2015 13:39:53 +0000

I am having trouble generating dtmf tones when I receive a call.  Here is what my call_state_changed callback looks like (this is in Python):

 

    def call_state_changed(core, call, state, message):

        logging.warning("call_state_changed: " + str(state) + ", " + message)

 

        if state == linphone.CallState.IncomingReceived:

            print "***Incoming call on " + core.identity

            core.accept_call(call)

            time.sleep(10)      # wait 10 seconds for audio to play

        elif state == linphone.CallState.Connected:

            core.start_dtmf_stream()

            core.play_dtmf(1,300)    # press 1 for 300 ms to acknowledge the alert

            core.stop_dtmf_stream()

            print "***Call successfully answered on " + core.identity

        elif state == linphone.CallState.End:

            print "***Call successfully hung up on " + core.identity

        elif state == linphone.CallState.Error:

            logging.error("call_state_changed: " + core.identity + ", " + str(state) + ", " + message)

 

When I am handling the linphone.CallState.Connected case, I am starting the dtmf stream, playing a ‘1’ digit for 300 ms, and then stopping the dtmf stream.  However, when I run my SIP client script and send a call to it, I get the following output in console when my client tries to generate the dtmf tone:

 

ERROR:root:No dtmf generator at this time !

 

I’ve made sure that both my client and my PBX are using the same DTMF payload type (rfc2833) (I’ve set use_rfc2833_for_dtmf to true in my core object).  What is required in order for me to create a dtmf generator?  I am not finding much help in the Linphone Python documentation.

 

Thanks!

 

-          Ken C.

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]