Shahal’s Blog

A blog about mobile development and other stuff too

Debugging FreeSWITCH native and managed on Windows

Hi again,

It’s been some time since my last post and I wanted to add a tip for those using FreeSWITCH on Windows.

I’ve been using FreeSWITCH on Linux and Windows for the last few months and I can say that on both platforms development is fairly easy. Although debugging is much easier on Windows ;-)

FreeSWITCH takes time to get used to, but once you understand the basics, you get to see the true power of call management.

Currently our team is focusing on using FreeSWITCH on Windows since we want to integrate .NET functionality.

We develop most of our code that is not related to FreeSWITCH in C#, so adding the managed C# into FreeSWITCH seemed the best solution for us.

One of the most important things during development is the ability to debug code. Most developers know how to debug code in a given language, but what happens when you’d like to debug an application, FreeSWITCH for example, that is written in two or more languages?

Well, visual studio 2008 (and probably 2005, but I haven’t tested it) lets you do that with only a minor change in the debugging options.

You can start running FreeSWITCH from Visual studio 2008, or run it from the command line by typing “freeswitch.exe” when you CD to the debug folder.

I recommend doing the latter since you need to attach Visual Studio to that process with a minor change.

Start freeswitch from command line

The second step is to attach to FreeSWITCH’s process and enable the debugging methods.

Attach to process

After you press the “select” you’ll see the form below, click on “Debug these code types:” and check the “Managed” and “Native“, click OK and you’re good to go.

Check managed native

After you attach to the process, you can debug the code in C and the .NET C# at the same time!

This was very helpful for me when writing code in C#. The code I wrote accesses web services and decides how to route the call according to the result from the web service (Jajah’s web service).

That’s it I guess.

And now for something completely different…

I’d like to recommend a nice add-on for firefox called: User Agent Switcher

This add-on adds a menu and a toolbar button to switch the user agent of the browser. Why is this good?

Well, you can disguise your Firefox browser to appear as IE, or Safari, but more important for me is the ability to browse mobile sites and download content for my mobile phone without using mobile data plans. There is lot’s of free stuff on Sony-Ericsson’s site and I like to browse it with Firefox (after changing my user agent to K530i) and discover and download games and GPS related application to my PC and then transfer them via bluetooth to my phone.

Any ideas about what you can do with the User Agent Switcher are more than welcome.

Until next time,

Happy Purim :-)

Tags: , ,

4 Responses to “Debugging FreeSWITCH native and managed on Windows”

  1. Diego Viola Says:

    FreeSWITCH is the best, it kicks Asterisk in every way.

  2. Chuck Tharp Says:

    Hello,

    I’m just curious, since you are using VS for your development on Windows. I’m getting a huge number of compile errors in the sofia code, using the downloaded source. I asked on the FS forums but have not received an answer as to what might be causing this. Did your group encounter these errors (using the solution file supplied from the FS download site)?

    Thanks…
    Chuck

  3. Shahal Hazan Says:

    Hi,
    We are using the version for VS 2008 (not express) - “Freeswitch.2008.sln”. It seems to work fine.
    I found that even when there were problems with the FreeSWITCH build, a few hours later or a day later they were fixed.
    I think this is due to the fact the FreeSWITCH is mostly developed on Linux and is tested less on Windows.
    When we did have problems, we asked some of the FreeSWITCH developers on the IRC and they helped us fix build errors, and after a couple of hours we got the update from the site.
    Well done FreeSWITCH developers !!!
    Happy developing.

  4. Murbaburb Says:

    Great site this jajahdevblog.com and I am really pleased to see you have what I am actually looking for here and this this post is exactly what I am interested in. I shall be pleased to become a regular visitor :)

Leave a Reply

Jajah is the VoIP player that brought you web-activated telephony.