Monday, August 28, 2006

Vonage VOIP Saga

We recently switched from ATT DSL to Charter Cable for Internet. My bother-in-law has had cable modems for years and I have always enjoyed the speed when over at his house. So when my SBC DSL contract ran out I signed up for Charter Cable. So far I have been pleased.

Now that we were free of DSL, we could sign up for VOIP. I went with Vonage because it is popular and I knew some folks that were using it and they didn't have any complaints.

I also had decided to try out a online backup program called ElephantDrive. It turns out that ElephantDrive sucks up all the outgoing bandwidth it can get its hands on (makes sense because it was doing a complete backup). My initial backup took weeks since I didn't let it run all the time. BTW, I was trying ElephantDrive because it was free. It is still in Beta and I wouldn't recommend it at this time since it sucks the life out of your machine when it runs and it takes forever to do a backup. However, it makes an excellent test program for using available upload bandwidth.

What I quickly discovered is the WRTP54G router that I paid extra for because I wanted to upgrade from my old 802.11b to 802.11g didn't prioritize my line so that VOIP worked. It is suppose to and Vonage tech-support tried their hardest to configure it to, but they just couldn't get a good outgoing connection when ElephantDrive was running. I kept getting Choppy, One-way, Dropped Audio. Finally advanced tech-support told me that I just couldn't run a program like this and expect good audio. Well, I didn't believe it. I knew that this could be done by prioritizing the packets using QoS. Actually, to be fair, I did finally get a hold of an advanced tech-support person who confirmed that you would need a high-end non-consumer grade router to accomplish what I was attempting to do.

After a number of calls and hours on the phone with tech-support and customer service, I convinced Vonage to replace my WRTP54G with a Motorola VT2442. I wanted to switch to the VT2442 not because I think it will provide better QoS, but so that I could get my $50 back that I paid extra for the WRTP54G. My VT2442 should come today.

I took the $50 and put it toward a WRT54GL. The 'L' stands for Linux. The WRT54GL allows you to add third-party firmware. So my plan is to implement this solution.

Stay tuned as I attempt to get good VOIP while running file uploads at the same time.

If I get it to work I plan on posting step by step instructions. Although the link above does a good job of that already.

Friday, August 11, 2006

VS 2005 Debugging C++ and C#

I was having problems attempting to step into a C# method from C++ using Visual Studio 2005. I asked Charles if he was able to get it to work and he said that he wasn't but that it should be possible. A few minutes later he had found this:

A handy trick when debugging C++ and C# in VS 2005...

For a project, go to Properties->Debugging and set the Debugger Type to Mixed from Auto. It now properly detects the associated languages, so one can step into a C# call from C++ and back.

Thursday, August 10, 2006

Emacs style indent line

One of the best features that Emacs provides is auto-formating of source code. When I moved to developing in Visual Studio 6, Justin provided the following macro that I mapped to the tab key that provided the same behavior.

Sub EmacsTab()
ext = GetFileExt(ActiveDocument.FullName)
if ext = "cpp" or ext = "h" or ext = "cxx" or ext = "hxx" or ext = "hpp" Then
With ActiveDocument.Selection
If .BottomLine > .TopLine Then
.SmartFormat
Else
col = .CurrentColumn
.StartOfLine dsFirstText
first = .CurrentColumn
.Indent
.SmartFormat
If col > first Then
.MoveTo .CurrentLine, col
End If
End If
End With
Else
ActiveDocument.Selection.Indent
End If
End Sub

When I moved to Visual Studio .Net 2003, the above macro no longer worked. So the following was created. Unfortunately you can no longer map the tab key, so I mapped it to ctrl-;.

Sub EmacsStyleIndentLine()
Dim ts As TextSelection = DTE.ActiveWindow.Selection
ts.SelectLine()
ts.SmartFormat()
ts.WordRight()
End Sub

Recently I moved to Visual Studio .Net 2005 and have been doing some C# coding. I found the above macro does not seem to work. Today I changed it to the following which appears to work just fine.

Sub EmacsStyleIndentLine()
With DTE.ActiveDocument.Selection
.LineUp()
.EndOfLine()
.Delete()
.NewLine()
.LineDown()
DTE.ExecuteCommand("Edit.FormatSelection")
End With
End Sub