Archive for the ‘voip’ Category

Put the Mitel 5220 phone into SIP mode

Sunday, April 27th, 2008

The world of SIP phones is constantly amazing to me. Crappy user interfaces, shady manufacturer websites, blackbox knowledge, i.e. “press and hold the ’super button’ after powering on and tap the second line button”.

I was asked to make sure a Mitel 5220 dual mode phone can be speak SIP and register to Asterisk. Looks like it can. Ironically, I figured all of this out without using the Mitel website since their homepage produced a 500 Internal Server Error response. Word!

The article on voip-info is accurate to get it into SIP mode. Some confusion arose on my phone because it didn’t have some buttons labeled. Trial and error nailed it down. Here’s the process:

  1. Disconnect the power from the set.
  2. Hold down the “Superkey” (or “Menu” key with some paper inserts) while powering up the set.
  3. The set will come up and ask if you want to CONFIGURE PHONE? select YES.
  4. “NETWORK PARAMETERS?” select NO
  5. “HARDWARE CONFIG?” select NO
  6. “PHONE MODE?” select YES
  7. “PROTOCOL?” select YES
  8. “PHONE MODE: Minet” select Change
  9. Select “SIP”, “Accept” and confirm with “Yes”. It will now save the settings to NVram
  10. “REBOOT NOW?” select Yes

The “super key” is the key at the top left, under the LCD screen. The “line 1″ button is the button at the bottom right, next to the keypad.

Web admin panel works. username: admin password: 5220. The registration process is a little odd, consisting of two discrete menus. Add the SIP user/pass in the Admin->User Config section, then add the SIP proxy/registrar in the Admin->SIP Config. Also in this section make sure the “Bypass NAT Firewall” is set to “off” and “Mode” is set to “static”. This applies if you are behind NAT and the Asterisk server is not. The settings are the opposite when both the server and the phone are on the same network.

Streaming an Asterisk conference room on an Icecast server

Saturday, March 1st, 2008

Ohhhhh snap! Really cool discovery today. In preperation for a workshop me and Ryan are doing at the Grassroots Media Conference, we sat down and did some hacking with Asterisk and Icecast. In the end I figured out how to take a conference room, define an administrative user in the form of a source client to Icecast and then broadcast all the following participants conversations via Icecast. Here’s details:

Three components are essential

  1. Asterisk 1.4 and a Zaptel timer for conference support
  2. Ices2, an ogg/vorbis source client for Icecast
  3. Icecast2, an internet radio server

I compiled Asterisk from source, as I always do. I’m using the 1.4 branch. I installed Icecast2 from Debian. I also installed Ices2 from Debian, though debian installed the binary as /usr/bin/ices2. Asterisk expects a binary named /usr/bin/ices. I made a symlink to fix this.

I configured Ices2 according to the example config in the Asterisk source code. It’s located in contrib/asterisk-ices.xml. Most of the defaults are acceptable. You’ll have to change the Icecast login info to match that of your own server. When you do this, su to the same user that Asterisk runs as and test connectivity. I did this via this command:
$ cat /dev/random | ices /etc/asterisk/asterisk-ices.xml
If that works, word up!

Now go into the Asterisk dialplan. I’m using FreePBX 2.2.1 as a front end to Asterisk. You’ll need to make an extension context like so in extensions_custom.conf:


[custom-ices]
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,SendDTMF(0000)
exten => s,n,Ices(/etc/asterisk/asterisk-ices.xml)
exten => s,n,Hangup()

This is one side of the automated call you’re going to set up. Next you have to define a conference room. This is pretty straight forward through FreePBX. Configure as needed.

Next you’ll do some of the magic. You have to automate a local call via the Asterisk Manager Interface. You can also use a .call file but I think that’s silly so I don’t do it.*

*silly = it doesn’t scale and depends on some weird system call stuff

Login to the manager on your Asterisk server. Be sure manager.conf is configured to allow access:
$ telnet (server IP) 5060

Then login using the provided documentation. I’ll leave this as an exercise to the reader. Finally, you have to originate a local call. This is all you need:


Action: Originate
Channel: Local/1000@ext-meetme
Context: custom-ices
Extension: s
Priority: 1

If you aren’t using FreePBX, you probably won’t have the ext-meetme context defined. If you are using FreePBX, the number before ext-meetme is the conference room number. When you execute this, it will trigger Asterisk to dial that number and when it answers, pick up with the context named custom-ices, which you will remember contains the information to start streaming to Icecast.

If you got this far, congratulations, you’re streaming silence from Asterisk! Next thing to do is bind some incoming numbers to the conference room. This is also an exercise to the reader. If you do this correctly, all users who call into the room will be broadcast on the mountpoint defined in Icecast.

Rid of Asterisk

Monday, October 1st, 2007

Asterisk is a cool SIP Proxy. It’s also a bunch of other things and it’s dialplan syntax totally sucks. OpenSER is a small fast SIP Proxy. Last week I finished an interesting project: replace Asterisk and hardware phones with OpenSER, Mediaproxy and software phones.

It took about 1 week and a half of hacking configuration syntax, reading through SIP headers and debugging soft phones to figure it out but now it’s done. Here’s what works for me.

  1. Install OpenSER from Debian stable. This should be easy. You’ll also need the MySQL module.
  2. Set up your database with /usr/sbin/openser_mysql
  3. Install Mediaproxy
  4. Configure the proxy and the dispatcher. You’ll need to configure it to accept control messages from localhost and RTP from the IP address of your host.
  5. Generate an OpenSER config from the sip:wise wizard I hate the word wizard when used in the context of a non-human software device that DOES NOT wear a robe or cap, but hey, this shit totally saved me time
  6. If you choose the “loose routing” option and you don’t know what it means, you’ll have to comment it out. There’s some code in the main route of the config file with the function has_totag(). Get rid of that condition.
  7. Read the comments of the generated file and follow the instructions. THIS IS VERY IMPORTANT. The wizard isn’t so magical he can read your mind.
  8. Download the xlite softphone for your platform of choice. I’m working on OS X and the Xmeeting softphone does not work behind NAT, which is the majority of users network layout.
  9. Accept the defaults and register to OpenSER as the user you created. You did remember to create a user, right?
  10. Do the same from some other network location. Then call the SIP URI of the other user. If you can talk both ways, congrats! You now have a software phone layout like Vonage.
  11. So yeah, that was my week. It was hard cause I was unaware of all the variables involved. If you try the above advice, it probably won’t work for you at first because you have to think about your network layout and adapt the pieces to fit. Examining logs and sniffing SIP headers were what saved my ass. If you don’t know what that means, all I did was use the tail and ngrep programs. I’ll leave the details of using them to you.

    This whole project taught me about SIP, which is pretty much the same thing as HTTP but for realtime voice. Status codes with headers and ACKs. The only difference is there is an SDP media description if your signalling works. Remember, signaling and payload are different. My situation was confusing because all the signaling worked but the payload was blocked by improper NAT configuration.

    So yeah, that’s it…on to video phones. It’s nice to be living in the future.

Idea: Custom Conversations With Artists

Saturday, September 29th, 2007

Coming back from the New York Art Book Fair I decided to post links of all the exhibitors to my del.icio.us feed under the tag nyartbookfair. Browsing through the list of publishers web sites, I noticed a particular publisher’s mission statement

A.R.T. Press primarily publishes books based on artist to artist conversations. The conversation format permits a thorough and at the same time informal investigation of the artists’ practice and the larger social issues that inform it. By virtue of their clarity, personal focus, affordability, and innovative method of distribution, these books make possible the presentation of contemporary artists and their work to a wide readership.

Then it hit me. Most people I know look at art books because they have large color prints of art they like. But there’s always lots of writing in these books. The writing is usually a conversation with the artist.

I’m going to make a series of recordings of different people reading artists answers to questions in these books. Then the user will call a telephone number. They will be presented with a menu to select from 9 artists to ask a question. Then they will speak their question and press the # key. Then they will hear a response by that artist. This question/answer combination will be recorded and later published as if the two really had that dialog.

Of course most of the dialogs won’t make sense…but the ones that do could be interesting.