Thursday, September 24, 2009

Get your Cisco 7941 to work with OCS with SmartSIP

I posted recently about a product from Evangelyze Communications (http://www.evangelyze.net/) called SmartSIP. In this post I'll talk about how to get your Cisco IP phone to work with OCS and SmartSIP.



Contrary to popular belief I prefer the Cisco phone to many others out there. The overall look and feel of the handset, base, buttons, and display are well thought out and provide some interesting and easy to use features.

For my lab setup I have my OCS Mediation server and SmartSIP collocated on the same virtual machine. By the way, don't  use VM's for production; they're not supported and performance can be terrible. I have a Cisco 7941 IP phone and have downloaded the latest SIP firmware from the Cisco web site (you need to have a valid SmartNET contract to get the code).

NOTE: Be sure to get the Cisco SIP firmware as the SCCP (skinny) won't suffice here.

After installing SmartSIP you will need to activate it and configure it as follows:
  • Change the gateway listening IP address on your Mediation server to 5070. You need to change the port here because SmartSIP needs to use 5061 for SIP Trunk service providers connecting inbound.
  • Change the port for the next hop PSTN gateway to 5055. Again, this port is changed because 5061 is used for SIP trunking.
  • Open the SmartSIP diagnostics application from the START menu
  • Click on the Config (Web UI) tab and select the Microsoft tab
  • Enter the IP address for your OCS server in the OCS SIP Listening Profile
Example:
data="ocs_rtp_ip=10.10.10.127"
data="ocs_sip_ip=10.10.10.127"
  • Click the Save button
Now you need to create a specific location profile for SmartSIP to use when routing calls. What I like about this process is that it leverages the UI in OCS to complete the digit manipulation (with normalization rules). You then route numbers based on the normalized (or de-normalized) numbers. If you're using a SIP Trunk to a carrier such as Thinktel they will accept E.164 formatted numbers so you shouldn't need to change much. If you're sending the call to a voice gateway via IP,  you can route numbers that have been pre-configured within OCS. Here's how:
  • Create a new Location Profile in OCS and call it something like "ss_test_1"
  • Create a new normalization rule for a number you want SmartSIP to route. For example if I wanted to de-normalize a number before routing to my carrier, I would actually use:
Pattern match: ^\+?1780(\d{7})$
Translation: 780$1
  • After you save this rule, go back into your SmartSIP WebUI and click on the Trunks tab.
  • Locate the smartsip_dialoptions_trunks and smartsip_locations_trunks tags and change the value to match your OCS location profile. For example:
data="smartsip_dialoptions_trunks=ss_test_1:sip_cid_type=pid"
data="smartsip_locations_trunks=ss_test_1:ss_test_1"
  • Now click on the General section below and expand it.
  • Change the gateway name to reflect your location profile such as:
gateway name="ss_test_1"
  • In the same section, be sure to enter the IP address of your next hop gateway or SIP provider in the "realm" and "proxy" tags.
Configure the Cisco phone...
Now that you have SmartSIP, OCS, and your voice normalization configured, we can move onto the phones. SmartSIP includes a TFTP server built in which permits your IP phones to download firmware and configuration data for automatic provisioning.

For the phones to find the SmartSIP server you will need to add "option 66" to your DHCP server. I found that on my Cisco 871 router I needed the following syntax in the DHCP pool settings:

option 150 IP 10.10.10.127
  • Log into your Mediation/SmartSIP server and locate the TFTP directory.
  • Populate the directory with your firmware data for the "Cisco 79xx" phone.


You should have something like this (minus the Desktops dir and dialplan.xml)

The Cisco phones need 2 files to operate properly. They are equally important so be sure to pay close attention to the next few steps.

SEP[MAC].cnf.xml
This file is your base configuration file for the phone. It contains information about where the phone needs to connect, what dialplan to use, etc. SmartSIP uses variables in the form of tags to replace the XML values in the file. For example, [USER] and [SERVER_IP] correspond to the extension and SmartSIP server IP. Consult the SmartSIP documentation for more information about what tags are available to you.

Over at Greenwire IT they have a great outline of a basic SEP[MAC].cnf.xml file: http://www.greenwireit.com/blog/2009/09/cisco-7961-and-7941-sip-configuration-sepmac-cnf-xml/

If you're stuck and need a copy of the XML, just let me know. I spent hours and hours trying to get the phone to sign in and provision itself only to find there were invalid values in the sample XML given by default.

Dialplan.xml
This file contains your dial plan for the Cisco phones. You can visit: http://sipx-wiki.calivia.com/index.php/HowTo_configure_Cisco_SIP_phone_with_sipX for a great sample. Be sure to place this in the "Cisco_79xx" directory.

Putting it all together...
Please please please be sure to install Wireshark on your Mediation/SmartSIP server if you haven't done so already. This will provide to be the most critical tool you will ever use. You're probably asking by now, "how do I assign a phone to a user?". The easiest way is as follows:
  • Open Active Directory Users & Computers.
  • Locate your OCS user and click on the Telephones tab of their account.
  • Type in sip:[MAC]@smartsip.local (where [MAC] is the MAC address of the Cisco phone)

  • Click Ok and close out the changes.
  • SmartSIP has a default 5 minute refresh on AD data so you can either wait or simply open the WebUI, click on the Users tab, then click the Update Directory button.
  • Now, open Wireshark and start a trace.
  • Plug in the Cisco phone to a PoE port.
  • Watch for TFTP requests in Wireshark to make sure the phone is at least talking to the server.
Now if you've done everything correctly, SmartSIP will see the request for TFTP data from a MAC address matching a user in AD. It will swap out the [MAC] tag in the SEP[MAC].cnf.xml file along with all the tags within it so they contain the user's name and extension (or DID). You can actually watch the Wireshark trace data to see the file being sent to the phone along with the correct data within it.

The dreaded "UNPROVISIONED" error...
The phone will show a message of "unprovisioned" if your CNF.XML isn't configured correctly. You can typically browse to your phone via http (i.e. http://10.10.10.12/) to view the phone logs. Pay special attention to the phone's log data as it will show you what's wrong. Edit your XML file appropriately to resolve the error.

BONUS: Configure wallpaper on the phone
  • Create a "Desktops\320x196x4\" directory below the "Cisco_79xx" directory included with SmartSIP.


  •  Get a copy of the image you want to edit, open Microsoft Paint (Windows 7 works best) and format the image to a size of 320x196.
  • Save the image as a PNG file (again Windows 7 has MS Paint that does this well now).
  • Create a "list.xml" file as follows:


  • The list.xml file contains a list believe it or not, of images available to the phone.
  • To choose an image hit the Settings button on the phone, select "User Preferences" then select "Background Images". The phone should contact the TFTP server for the data (again Wireshark is the best tool to watch for this).
That's all for now. Cheers!

No comments:

Post a Comment