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

5 comments:

M.K. said...

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

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!

Oliver Gaida said...

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