[Top][All Lists]

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

Re: [Linphone-users] No dtmf generator when attempting to play dtmf [Pyt

From: Ghislain MARY
Subject: Re: [Linphone-users] No dtmf generator when attempting to play dtmf [Python]
Date: Mon, 21 Sep 2015 16:10:06 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Hi Ken,

You need to wait for the StreamsRunning CallState before playing DTMFs.
Moreover, if you call core.stop_dtmf_stream() directly after calling core.play_dtmf(1,300) the DTMF will stop immediately after being started and will not last 300ms.


On 16/09/2015 15:39, Kenneth Clive wrote:

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


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

        elif state == linphone.CallState.Connected:


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


            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.




-          Ken C.


reply via email to

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