Loading ...
Sorry, an error occurred while loading the content.

Re: Feature requests

Expand Messages
  • Aurélien
    ... OK. So this is what I was thinking about : could you make twinkle run a script when different events occur, like an incoming call, end of a call, call
    Message 1 of 9 , Nov 1, 2006
    View Source
    • 0 Attachment
      > this forum is the perfect place to post ideas, requests aso.

      OK. So this is what I was thinking about : could you make twinkle run
      a script when different events occur, like an incoming call, end of a
      call, call rejection, and missed call ?
      My objective is to pause Amarok when a call arrives, and to unpause it
      when I'm done or if I reject the call.
      Also, it could be useful to run a script when I miss a call, for
      example to send me an email or a jabber message.

      That would really rock.

      Thanks,
      Aurélien
    • Michel de Boer
      ... Twinkle can do this already! You can provide your scripts in the Scripts section of the user profile. See the manual on my website for an explanation and
      Message 2 of 9 , Nov 1, 2006
      View Source
      • 0 Attachment
        > OK. So this is what I was thinking about : could you make twinkle run
        > a script when different events occur, like an incoming call, end of a
        > call, call rejection, and missed call ?

        Twinkle can do this already! You can provide your scripts in the
        Scripts section of the user profile. See the manual on my website
        for an explanation and examples of how to use the scripts.

        > My objective is to pause Amarok when a call arrives, and to unpause it
        > when I'm done or if I reject the call.
        > Also, it could be useful to run a script when I miss a call, for
        > example to send me an email or a jabber message.

        Use the "incoming call failed" trigger. By checking on the status
        code of the failure response you can determine if it is a missed
        call:

        *) 487 --> caller hung up before you answered
        *) 480 --> twinkle sends this failure when the no-answer timer (30 s)
        expires.

        >
        > That would really rock.

        Have fun rocking :)

        --
        Michel de Boer
        www.twinklephone.com
      • Aurelien Bompard
        ... This was SOOOO obvious. Right under my nose. Sorry for bothering, I ll try that ASAP ! Aurélien. -- http://aurelien.bompard.org ~~~~ Jabber :
        Message 3 of 9 , Nov 1, 2006
        View Source
        • 0 Attachment
          > Twinkle can do this already! You can provide your scripts in the
          > Scripts section of the user profile. See the manual on my website
          > for an explanation and examples of how to use the scripts.

          This was SOOOO obvious. Right under my nose.

          Sorry for bothering, I'll try that ASAP !

          Aurélien.
          --
          http://aurelien.bompard.org ~~~~ Jabber : abompard@...
          "Programming today is a race between software engineers striving to build
          bigger and better idiot-proof programs, and the Universe trying to produce
          bigger and better idiots. So far, the Universe is winning." -- Rich Cook
        • Michel de Boer
          Hi, It seems you sent your mail to me instead of to the mailing list. There are several problems with your script. First of all, Twinkle cannot play sound when
          Message 4 of 9 , Nov 2, 2006
          View Source
          • 0 Attachment
            Hi,

            It seems you sent your mail to me instead of to the mailing list.

            There are several problems with your script.

            First of all, Twinkle cannot play sound when autoanswer is
            enabled. It is a nice suggestion though to have Twinkle play
            a wav file when a call is answered by autoanswer.

            The ringtone parameter in the scripts will only set
            the ringtone for an incoming calls without autoanswer.
            You should only ouput 1 action in a script.
            "action=end" is not valid. To end parameter can
            be ouput on its own, e.g.

            print "end"

            You could make a script that plays a sound and makes Twinkle
            autoanswer a call.


            import os
            import sys

            print "action=autoanswer"
            print "end"

            # Now Twinkle will autoanswer the call and the script can
            # continue playing a tone.

            # Play a tone via ALSA using aplay
            os.system("aplay /usr/share/sounds/KDE_Beep_Door.wav")

            I have not tested this script, but I believe it should work.
            You only need to take care that when you play the sound
            on the same soundcard as Twinkle plays the voice channel of
            your call that you use the ALSA default device for both
            for mixing the sounds.

            If your sound is very short, you can try to play the sound before
            answering the call. As long as the sound plays though, the
            calling party will get silence.

            Regards,
            Michel


            el_moy wrote:
            > Hi All!
            >
            > I was also playing with scripts.
            >
            > When autoanswer is enable, it would be nice if twinkle plays a sound
            > announcing that you are already on a call! Maybe you are just singing
            > without even notice that somebody is listening to you :).
            >
            > I did the following python script:
            >
            > #!/usr/bin/python
            >
            > # Playing a sound when autoanswer is enabled and the call was taked
            >
            > import os
            > import sys
            > import time
            >
            >
            > print "action=continue"
            > print "ringtone=/usr/share/sounds/KDE_Beep_Door.wav"
            > print "action=autoanswer"
            > print "action=end"
            > sys.exit()
            >
            > But my script is not working properly. Any help would be greatly
            > appreciated.
            >
            > Best Regards!
            >
            >
            >
            >
            >

            --
            Michel de Boer
            www.twinklephone.com
          • joerg.greoj
            ... some different approach, untested as well (this time a ... #!/bin/bash time-to-play-ringtone-in-sec=15 echo action=continue echo
            Message 5 of 9 , Nov 2, 2006
            View Source
            • 0 Attachment
              --- In twinklephone@yahoogroups.com, Michel de Boer <michel@...>
              wrote:
              >...
              > You could make a script that plays a sound and makes Twinkle
              > autoanswer a call.
              >
              >
              > import os
              > import sys
              >
              > print "action=autoanswer"
              > print "end"
              >
              > # Now Twinkle will autoanswer the call and the script can
              > # continue playing a tone.
              >
              > # Play a tone via ALSA using aplay
              > os.system("aplay /usr/share/sounds/KDE_Beep_Door.wav")

              some different approach, untested as well (this time a
              shell-script):
              ---start---[quote]
              #!/bin/bash
              time-to-play-ringtone-in-sec=15
              echo "action=continue"
              echo "ringtone=/usr/share/sounds/KDE_Beep_Door.wav"
              echo "end"
              sleep $time-to-play-ringtone-in-sec
              twinkle --cmd answer; #make twinkle take the call
              #if you like, continue like this:
              kdialog --msgbox "twinkle offhook, click OK to end call"; #include
              # caller-id from env here if you like
              twinkle --cmd bye; #should handle line from call-signaling to cope
              # with conference etc. this script pre-alfa ;-)
              [/quote]---end---
              dunno, might work as well. avoiding the drawbacks of previous
              solution - and surely introducing other ones.

              cheers
              jOERG
            • Aurelien Bompard
              ... Or maybe run it in the background, something like this #!/bin/sh aplay /usr/share/sounds/KDE_Beep_Door.wav & echo action=autoanswer echo end (untested
              Message 6 of 9 , Nov 2, 2006
              View Source
              • 0 Attachment
                > If your sound is very short, you can try to play the sound before
                > answering the call. As long as the sound plays though, the
                > calling party will get silence.

                Or maybe run it in the background, something like this

                #!/bin/sh
                aplay /usr/share/sounds/KDE_Beep_Door.wav &
                echo "action=autoanswer"
                echo "end"

                (untested too)


                Aurélien
                --
                http://aurelien.bompard.org ~~~~ Jabber : abompard@...
                Go away or I will replace you with a very small shell script
              • joerg.greoj
                ... no need to do that - the script is allready detached from twinkle the moment twinkle sees the end cmd (or EOF) on scripts stdout (=closes stdin and
                Message 7 of 9 , Nov 2, 2006
                View Source
                • 0 Attachment
                  --- In twinklephone@yahoogroups.com, Aurelien Bompard <gauret@...>
                  wrote:
                  > Or maybe run it in the background, something like this
                  >
                  > #!/bin/sh
                  > aplay /usr/share/sounds/KDE_Beep_Door.wav &
                  > echo "action=autoanswer"
                  > echo "end"

                  no need to do that - the script is allready "detached" from twinkle
                  the moment twinkle sees the "end" cmd (or EOF) on scripts stdout
                  (=closes stdin and stdout to script-process and continues running).

                  doing the way you suggest has the disadvantage of starting another
                  shell-process without any need. only difference was: twinkle might
                  take sounddev 0,001sec _before_ aplay, whereas on michels script
                  aplay was a millisec first to grab sounddev. shouldn´t matter when
                  you have dmix or multiplexing sound-hw.

                  jOERG
                Your message has been successfully submitted and would be delivered to recipients shortly.