INPUT MY OUTPUT
Wowzers! A lot of new material this week in the Asterisk world. First of all, I learned how to use SIP and IAX2 to make calls. For this I started with a SoftPhone (Zoiper Classic) – using it to call the Asterisk server. Below is my sip.conf

[rtt233]
type=friend
username=rtt233_sip
secret=XXXXXXX
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=gsm
nat=yes
qualify=yes
context=rtt233_sip

Below is my dialplan for SIP:

[rtt233_sip]
exten => _X,1,GoTo(rtt233_sip_answer,s,1)
 
[rtt233_sip_answer]
exten => s,1,Playback(hello-world)
	same => n,Playback(auth-thankyou)
	same => n,Hangup()

Below is my iax.conf:

[rtt233_iax]
type=friend
host=dynamic
username=rtt233_iax
secret=XXXXXXXX
auth=md5
requirecalltoken=no
context=rtt233_iax

Below is my dialplan for IAX:

[rtt233_iax]
exten => _X,1,GoTo(rtt233_iax_answer,s,1)
 
[rtt233_iax_answer]
exten => s,1,Playback(hello-world)
	same => n,Playback(auth-thankyou)
	same => n,Hangup()

My dialplan and setup files here are pretty plain, but it was great to see the connection being made from my machines softphone to the Asterisk server. After this I learned about dialing to a real phone using SIP:

exten => s,1,Dial(SIP/itp_jnctn/19175551234,30,r) ;SIP call

An alternative to this – one can let the user choose a number to dial with:

exten => _1NXXNXXXXXX,1,Dial(SIP/itp_jnctn/${EXTEN},30,r) ;dials any valid North American phone.

As well as calling a machine through the dial plan IAX2:

	same => n,Set(CALLERID(num)=12125551234) ;set caller ID
	same => n,Dial(IAX2/rtt233_iax,30,r)

Alright…So we have simple dialing down…how can we save variables so that they can be reused over multiple calls? With Asterisk we can save variables to a Database(DB). Check out the below DB calls that can be used in any dialplan:

	same => n,Set(numOfCalls=${DB(rtt233/calls)}) ;set # in database
	same => n,Set(numOfCalls=$[1 + ${numOfCalls}]) ;add 1 to it
	same => n,Set(DB(rtt233/calls)=${numOfCalls}) ;take # from database
	same => n,SayDigits(${numOfCalls}) ;say # of calls

For Appropriating New Technologies I used Jason Saragih’s C++ Face Tracker code alongside with Kyle McDonald’s ofxFaceTracker library found on his github here. In essence I’m using the face tracking code to get a 1 mask on a static image and another mask from my webcam stream. I then use the TextureMesh from the static image to map it onto my webcam mask. Lastly, I position/translate my mask (with the static image textured onto it) into the same position that if found the static mask so that it looks like it is part of the static image. This allows me to puppeteer the image. My code can be downloaded on my Github here.

The video I made is an art piece to puppeteer what many american’s feel is the ultimate puppet – US Presidents. With puppeteering I’m trying to pull out the inner child in famous presidents who are forced into a very public and very serious role. My goal of this is to have babies and young children control these serious figures. I wasn’t able to find a child to control the puppets with this week, but plan to redo this piece with the proper pupet master.

Lastly, I’d like to give another huge applaud to Jason Saragih, Kyle McDonald, and Arturo for making this technology open source and accessible for newb inventors like myself. It’s really amazing that we can all use this type of face tracking and I can’t even imagine what we will be using in 20 years…

soundrack feat Jay-Z – Forever Young

I’ve always been fascinated by Emotional Intelligence (EQ) and feel it often takes a backseat to peoples fascination in IQ and making things quantifiably intelligent. As with computing, the machine has been built to be able to perform highly data intensive procedures at extremely high speeds, but we still haven’t uncovered emotional computing. For my Research Algorithms class I’ll be making a computer that feels emotions.

There are two types emotions that drive our life and our actions: 1) the way in which we understand the emotions around us (example – facial expressions, gestures, tone of voice) and 2) the way in which we feel emotions for ourselves. Through this external and internal process we are able to listen to emotions, think about emotions, and react to emotions.

There have been a lot of really great examples in the field of understanding emotions. The two videos presented to the left use robotics (from MIT Media Lab and Cambridge) to mimic human emotions. Although they seek realistic in terms of movement and understanding and are extremely impressive accomplishment, the ability to think and feel for oneself is missing.

In 2004, the Washington Post asked its readers, “If computers are to have emotional components, what role would they play in everyday life? Do human beings really want an emotional relationship with a mechanical mind?” Through media we’ve seen many instances of computers that can feel however the consequence of these machines existence is often portrayed as a threat to the human kind. Hal in 2001 Space Odyssey attempts to kill all the humans on a spaceship, in I-Robot the ability to feel leads to murder and suicide, and in A.I. Artificial Intelligence, David follows a path similar to Pinocchio with a heartbreaking conclusion where he relizes he will never be a real boy and that the mother he loves has to die. Although Hollywood portrays machines with emotions as an evolutionary disaster, I believe there is a deeper meanings that can be derived from creating a computer that feels.

This week I used Asterisk to create a beatbox where a user is given a continuous beat. As the beat loops a user can break out of it and contribute to the music by pressing two on their keypad. This initiates a record application that records a users audio input at a lower pitch and then places it back within the stream of the beatbox. Right now the beat and the recorded sound play back-to-back. In future iterations I would like to use Sox to combine the audio files on the fly to create a seamless sound integration.

Below is my code

[rtt233]
exten => s,1,Wait(1)
exten => s,n,Playback(/home/rtt233/asterisk_sounds/intro)
exten => s,n,Goto(rtt233_beat,s,1)
 
[rtt233_beat]
exten => s,1,Playback(/home/rtt233/asterisk_sounds/recordstart)
	same => n,Background(/home/rtt233/asterisk_sounds/beat, m)
	same => n,Goto(rtt233_beat_withoutRecorded,s,1)
	same => n,WaitExten(30);
 
[rtt233_beat_withoutRecorded]
exten => s,1,Background(/home/rtt233/asterisk_sounds/beat, m)
	same => n,Goto(rtt233_beat_withoutRecorded,s,1)
	same => n,WaitExten(30);
 
exten => 2,1, Playback(/home/rtt233/asterisk_sounds/recordend)
	same => n,Set(PITCH_SHIFT(rx)=0.7)
	same => n,Record(asterisk-recording%d:ulaw);
	same => n,Goto(rtt233_beat_withRecorded,s,1)
	same => n,WaitExten(30);
 
 
[rtt233_beat_withRecorded]
exten => s,1,Background(/home/rtt233/asterisk_sounds/beat, m)
	same => n,Playback(${RECORDED_FILE})
	same => n,Goto(rtt233_beat_withRecorded,s,1)
	same => n,WaitExten(30);