Monday, June 29, 2009

Automate your dialling with Bookmarklets !

It is more often these days we need to look in the number in the website and dial the same number reach the service. Instead you can create a bookmarklet in your browser to send the number by selecting it to asterisk and connect your phone with the service provider with a select and click.

So nothing to paste or no wrong number dialling. Just Select and click.

Asterisk can be communicated through http interface, send an AMI originate command with the number you want to dial in with the format. It goes from there.

Listen to your computer songs anywhere in the air

Recently explored a bit more on the shoutcast to broadcast songs from my machine. It works well with winamp. Download the softwares from shoutcast and install the plugin for winamp appropriately, you are done.

Now open the shoutcast app in your iphone and search for your station. (Make sure you select the option as public radio in yp to search for your radio). Now you are done. You can now listen to your computer songs on your iphone.

One of the features I love it. I would like to extend this for our village benefit, so that we hear village news using this public radio. The bottle neck here is the bandwidth of the broadcaster. I would best use of multicast in this scenerio.

Listen to the blog. More coming.

Wednesday, June 24, 2009

Asterisk How to Capture Events and Handle it with PHP easily, works with all 1.2, 1.4 & 1.6

PHP makes the life easily when it comes to string parsing. Just enjoy to handle the events from asterisk.

#!/usr/bin/php -q

ob_implicit_flush(false);

$socket = fsockopen("hostname or ip","port", $errornum, $errorstr);
if(!$socket) {
print "Couldn't open socket. Error #" . $errornum . ": " . $errorstr;
} else {
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: username\r\n");
fputs($socket, "Secret: password\r\n\r\n");
fputs($socket, "Action: Events\r\n");
fputs($socket, "EventMask: on\r\n\r\n");

fgets($socket); // Ignore the welcome message

$change = false;
$agentid = NULL;
$agentchannel = NULL;
$login = NULL;

while(true)
{
while(!feof($socket) )
{

$readbuf = "";
$resp = fread($socket,8192);
$readbuf .= $resp;
$allevents = split("\r\n\r\n",$readbuf);
foreach($allevents as $event)
{
$eventdetails = split("\r\n",$event);
$event_assoc = "";
foreach($eventdetails as $value ) {
$namevalue = split(": ",$value);
$event_assoc[$namevalue[0]] = $namevalue[1];
}
switch( $event_assoc['Event'] )
{
case 'Link': // Calls getting bridged
break;

default:
if( !empty($event_assoc['Event']) )
print_r($event_assoc);
}
}
fputs($socket, "Action: Ping\r\n\r\n");
usleep(1000000);
}

}

}

?>

Friday, June 19, 2009

Internet Radio Station on the Air

It was one of my dream to listen to radio stations from the Internet while driving or in free space without needing any bulky device. With the advanced computing and lightweight chips in electronics Apple made it to happen.

The dream came true with iphone and shoutcast player. You can either listen to the stations available online or you can broadcast your own station from your home pc and listen it everywhere you keep in touch with 3G or on the air networks.

Thanks to Iphone and Shoutcast.

Tuesday, June 9, 2009

How good is your browser?

Was wondering how to find whether I'm using the right browser with my computer. Recent technologies and websites changed the way we browse and use them. It is necessary to find the right browser for our computer to get the best performance for what we have.

http://service.futuremark.com/peacekeeper/index.action

gives the good benchmark. It voted me for Safari 4. Moved from firefox 3 to Safari 4 for now.

I can feel the difference. What about for you ? !