Wednesday, January 16, 2013

Fritz!Box 7360 hacks

I've switched recently to this nice piece of hardware, a Fritz!Box 7360. Paired with a Fritz!Fon M2 DECT handset it makes a nice combination of a VDSL modem/router/access point with among other things, VoIP telephony features.

Everything worked as advertised, except for the VoIP connectivity with my Greek provider Viva.gr. Connection establishment was performed, however, when a call was initiated/received the voice quality was terrible with interruptions and clicking sounds. It made VoIP calls really impossible.

After Googling around I've verified the problem to be caused by a wrong selection of voice codec. It was using the G729 codec that although worked fine with the same VoIP provider and e.g. a CSipSimple client on Android, somehow it didn't work well with the Fritz!Box.

To change this manually:

Dial #96*7* on the handset to enable telnet access, then telnet to your box:
$ telnet fritz.box (type admin password)


Use a special version of vi to edit the voip configuration:
# nvi /var/flash/voip.cfg

look for the following snippet:
    ...
    use_audiocodecs = no;
    audiocodecs = "G729", "PCMA", "PCMU",  G726-32", "G726-40", "G726-24";
    verbose = no;
    capi_blocksize_in_ms = 30;
    sip_prio = 0;
    rtp_prio = 0;
    rtcp_prio = 0;
    dyn_codecs = yes;
    prio_low_codec = no;
    ...

Set ' use_audiocodecs' & 'prio_low_codec' to yes, and change the 'audiocodecs' to the ones you are interested in. In my case, I've removed all codecs but the high quality PCM ones, which are essentially G711. The relative section in my config now looks like:

    use_audiocodecs = yes;
    audiocodecs = "PCMA", "PCMU";
    verbose = no;
    capi_blocksize_in_ms = 30;
    sip_prio = 0;
    rtp_prio = 0;
    rtcp_prio = 0;
    dyn_codecs = yes;
    prio_low_codec = yes;

:wq to save your changes and issue a
# voipcfgchanged
to restart the voip daemon.
Finally, dial a #96*8* on your handset to disable telnet access on your Fritz!box and you are done.

With this change Fritz!Box will switch from "G.729a" or G.726-32 and what-not to using the G711 voice codec. You can verify this by making a test call over VoIP then connecting with the web browser to the Fritz!Box admin interface and in advanced mode goto "Own Telephone Numbers" then click on the "Voice Transmission" tab and check the codec used in the test call.

This is all, enjoy VoIP calls and Kudos to Dave and Patrick.

/Dimitris

7 comments:

M.K. said...

To disable the telnet daemon, dial:
#96*8*

Honza said...

To edit Fritz!Box VoIP settings you can use FBEditor better.

Dimitris Andreadis said...

@Honza

thanks for the tip, I'll try it out!

Unknown said...

thanx a lot Dimitri, it works too on my fritzbox 7490 without any problems.

Andre Jolivet said...

Thank you, you saved my evening. I was running in circles, trying several voip providers. The calling voice quality of my Fritzbox suddenly dropped from very good to choppy and not acceptable, and everything is now back to perfect after following your tip. One remark : each time you erase the number in the Fritzbox, you need to redo the process.

ptoube said...

I have the same problem with background noise and crackling with 7270 and 7360. NOT at VoIP but with dect connection. I have ote landline, and two Panasonic wireless phones. Both of them have background noise when connected as dect. They don't have problem when I connect them to fon1 connection. They both use g726 codecs as I can see in the Fritz menu. Can I change the codecs for sect as well as you did for VoIP;
Thnx
Panos

Dimitris Andreadis said...

@ptoube, my guess is you should be able to configure them but I've had a quick look and I cannot see an entry for those in the configuration file.

In addition, after the latest firmware upgrade, I cannot even telnet to the box.