Phone Parrot

August 29, 2006

Author: jart — Originally Posted 1290 Days Ago Article Tags « asterisk c »
[Photo of a parrot]

PhoneParrot is an IVR application for Asterisk that will repeat everything a person says in to the phone.

exten => 666,1,Parrot()

For example, you could have PhoneParrot call your mother in the middle of the night. She will pick up the phone and say "moshi moshi", the phone parrot will then say "moshi moshi". Your mother, confused will then probably say, "who is you playa?" to which the phone parrot will respond, "who is you playa?". I think you get the idea.

But phone parrot can do more than just repeat what a person says! Here are some of the cool features:

  • Apply voice change effect to repeated voice (Only if libsoundtouch4c is installed and phone parrot is compiled from source)
  • Play random sound clip if caller rambles on for too long
  • Greet with random sound clip in response to first thing caller says
  • ToDo: Repeat things previously said in conversation

Download

[zip] phoneparrot-0.1.1.tar.gz (14KB, Released 2009-02-07)
[zip] phoneparrot-0.1.tar.gz (27KB, Released 2006-08-29)
[txt] Changelog (459B)

Installation

On your functioning Linux machine running Asterisk with the header files installed to /usr/include/asterisk, run the following commands to install phoneparrot:

# install phoneparrot
cd /usr/src
wget http://www.lobstertech.com/code/phoneparrot/releases/phoneparrot-0.1.tar.gz
tar -xzvf phoneparrot-0.1.tar.gz
cd phoneparrot-0.1
make
make install

# load it in to asterisk
make start

Documentation

*CLI> show application Parrot

  -= Info about application 'Parrot' =-

[Synopsis]
Repeats back to caller what they say like a God damn child

[Description]
Parrot(options)

Description:
  When this application is invoked, it will record to memory what
  the caller is saying.  When the caller stops talking, recording
  buffer of what s?he just said is played back.

  You may also chose to add a voice pitch change effect to what
  the caller just said with the P() option.  Pitch is specified
  in semi-tones.  -5.0 is good for making the voice lower and
  5.0 is good for making the voice higher.

Options:
  T(...) - Silence Threshold, default 256
  W(...) - Milliseconds of silence before repeat.  Default 1000
  N(...) - Minimum time in milliseconds the caller needs to talk
           for voice to be echo'd back.  Default 400
  M(...) - Max milliseconds of talk to buffer.  Default 6000
  S(...) - If caller rambles for more than length of call buffer,
           play a random one of these sound clips instead. List
           is delimited by '^'.  Maximum of 16.  These may not be
           interrupted.
  G(...) - Play greeting clip in response to initial thing caller
           says.  In my testing I noticed that people get a little
           confused and just keep saying hello if you start them
           off in plain old parrot mode.  Here, you can specify a
           list of sound clips from which to randomly choose just
           like with S() here.
  H(...) - Hangup after a certain number of seconds
  I(...) - Repeat may be interrupted if caller speaks for '...'
           milliseconds.  Default is 400, 0 turns off
  P(...) - New pitch of voice echo'd back. Default 0.0

Legal

Phone Parrot
Copyright (c) 2006 Lobstertech, Inc.
Keep it Open Source Pigs

The program found on this page is free software and may be used, distributed, and modified under the terms of the GNU General Public License version 2.0.

This software is distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Comments

  1. John on October 26, 2008 [Permalink]

    Great Work!!!

    whats on the works? ;-)

  2. William on February 3, 2009 [Permalink]

    Not able to compile Parrot app. I compiled the voicechanger on the same box just fine.

    /usr/src/phoneparrot-0.1# make
    ./mkdep -O -g -Wall -fpic -shared -D_GNU_SOURCE -D_LIBSOUNDTOUCH4C_ app_parrot.c
    cc -O -g -Wall -fpic -shared -D_GNU_SOURCE -D_LIBSOUNDTOUCH4C_ -c -o app_parrot.o app_parrot.c
    app_parrot.c:38: warning: data definition has no type or storage class
    app_parrot.c:38: warning: type defaults to ‘int’ in declaration of ‘STANDARD_LOCAL_USER’
    app_parrot.c:39: warning: data definition has no type or storage class
    app_parrot.c:39: warning: type defaults to ‘int’ in declaration of ‘LOCAL_USER_DECL’
    app_parrot.c: In function ‘parrot’:
    app_parrot.c:422: warning: implicit declaration of function ‘LOCAL_USER_ADD’
    app_parrot.c:426: warning: implicit declaration of function ‘LOCAL_USER_REMOVE’
    app_parrot.c: In function ‘unload_module’:
    app_parrot.c:528: error: ‘STANDARD_HANGUP_LOCALUSERS’ undeclared (first use in this function)
    app_parrot.c:528: error: (Each undeclared identifier is reported only once
    app_parrot.c:528: error: for each function it appears in.)
    app_parrot.c: In function ‘usecount’:
    app_parrot.c:545: warning: implicit declaration of function ‘STANDARD_USECOUNT’
    make: *** [app_parrot.o] Error 1

  3. jart on February 7, 2009 [Permalink]

    Try the new 0.1.1 release. That should support Asterisk 1.4.x

  4. Bob on February 17, 2009 [Permalink]

    This is awesome! Thanks a lot!!!!

  5. Pete on August 10, 2009 [Permalink]

    I installed the latest version ok, but when I call the extension, I just get silence?

    Calling 666 shows me this :

    Executing [666@default:1] Parrot("SIP/pstn-001961e8", "H(5)") in new stack

  6. Shaka on November 4, 2009 [Permalink]

    @pete

    In your extensions.conf, set the priority 1 to application answer and the call the application parrot:

    exten => 666,1,answer()
    exten => 666,2,parrot()

    for developers:
    Parrot doesnt work wih asterisk 1.6.X, there is a patch or something like?

  7. lasapster on November 26, 2009 [Permalink]

    I am trying to install phoneparrot-0.1.1 in elastix with asterisk 1.4.5 but was getting the error as below

    gcc -O -g -D_GNU_SOURCE -shared -fpic -D_LIBSOUNDTOUCH4C_ -c -o app_parrot.o app_parrot.c
    app_parrot.c:24:27: error: asterisk/file.h: No such file or directory
    app_parrot.c:25:28: error: asterisk/frame.h: No such file or directory
    app_parrot.c:26:30: error: asterisk/options.h: No such file or directory
    app_parrot.c:27:29: error: asterisk/logger.h: No such file or directory
    app_parrot.c:28:30: error: asterisk/channel.h: No such file or directory
    app_parrot.c:29:26: error: asterisk/pbx.h: No such file or directory
    app_parrot.c:30:29: error: asterisk/module.h: No such file or directory
    app_parrot.c:31:27: error: asterisk/lock.h: No such file or directory
    app_parrot.c:32:26: error: asterisk/app.h: No such file or directory
    app_parrot.c:33:26: error: asterisk/dsp.h: No such file or directory
    app_parrot.c:38:35: error: asterisk/stringfields.h: No such file or directory
    app_parrot.c:124: error: expected â)â before â{â token
    app_parrot.c: In function âsoundtouch_createâ:
    app_parrot.c:163: error: âLOG_DEBUGâ undeclared (first use in this function)
    app_parrot.c:163: error: (Each undeclared identifier is reported only once
    app_parrot.c:163: error: for each function it appears in.)
    app_parrot.c:166: error: âLOG_WARNINGâ undeclared (first use in this function)
    app_parrot.c: In function âsoundtouch_freeâ:
    app_parrot.c:181: error: âLOG_DEBUGâ undeclared (first use in this function)
    app_parrot.c: At top level:
    app_parrot.c:196: warning: âstruct ast_channelâ declared inside parameter list
    app_parrot.c:196: warning: its scope is only this definition or declaration, which is probably not what you want
    app_parrot.c: In function âparrot_mainâ:
    -----------
    -----------

    app_parrot.c:526: warning: passing argument 1 of âparrotâ from incompatible pointer type
    app_parrot.c: At top level:
    app_parrot.c:566: error: expected â)â before string constant
    make: *** [app_parrot.o] Error 1

  8. jart [website] on November 29, 2009 [Permalink]

    @lasapster: You probably forgot to install the development package from your package manager.

    You need to do something like this:

    sudo apt-get install asterisk-dev

  9. las [website] on November 29, 2009 [Permalink]

    Hi Jart .. Thanks for your prompt reply .

    Am installing the pbx engine not from scratch ... In elastix i believe it was installing through rpms .. and i couldn't find the development packages and directory called asterisk inside the directory /usr/include.
    I tried to locate the the file.h and could't find the file.

    My pbx engine was working fine with out any issue.
    Is there any way to find the the directory of asterisk develpoment packages in elastix.
    Thanks in advance
    :)

  10. Chris on December 8, 2009 [Permalink]

    Any luch with 1.6?

  11. Neil Stone [website] on February 1, 2010 [Permalink]

    Fails to compile on my system with Asterisk 1.6.2.0.

    Shame, sounds like a lot of fun...

Post Comment