Unable to re-open DSP device with fritzbox as sip phone for asterisk

I am going trough a basic asterisk tutorial, but I fail [at this point](https:// Unable to re-open DSP device): I am trying to register a sip phone to make calls from and to asterisk.

asterisk CLI:

*CLI> console dial 3000
[Jan 19 13:40:11] WARNING[489]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Jan 19 13:40:11] NOTICE[489]: console_video.c:136 console_video_start: voice only, console video support not present
[Jan 19 13:40:11] WARNING[490][C-00000002]: app_dial.c:2580 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
[Jan 19 13:40:12] WARNING[490][C-00000002]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Jan 19 13:40:13] WARNING[490][C-00000002]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory

extensions.conf:

[default]
exten => 1001,1,Answer()
exten => 1001,2,Playback(hello-world)
exten => 1001,3,Hangup()
exten => 3000,1,Dial(SIP/3000)

sip.conf:

[general]
 context=unauthenticated
 port=5070
 ;bindport=5070
 bindaddr=0.0.0.0
 localnet=192.168.103.0/255.255.255.0               ; Netzwerk und Maske Fritzbox
 nat=force_rport,comedia instead
 allowguest=no
 alwaysauthreject=yes
 qualify=no

 language=de                                         ; Default language setting for all users/peers
                                                    ; This may also be set for individual users/peers
 tonezone=de                                         ; Default tonezone for all users/peers
                                                    ; This may also be set for individual users/peers

 register => asterisk:mysecret@fritz.box/620

[620]
 type=peer
 qualify=no
 host=192.168.103.1                                 ; IP der Fritzbox
 fromdomain=fritz.box
 fromuser=asterisk
 defaultuser=asterisk
 secret=mysecret                                   ; Passwort: Ich verwende in asterisk immer das selbe
 insecure=port,invite
 directmedia=no
 disallow=all
 allow=alaw
 allow=ulaw
 context=fritz_in

[3000]
 type=peer
 username=3000
 host=dynamic
 dtmfmode=rfc2833
 secret=mysecret
 canreinvite=yes
 context=
 insecure=port,invite

This is what my fritzbox says:

[
9.01.22
14:35:07
Internettelefonie mit 620@10.184.175.249:5070 über 10.184.175.249:5070 war nicht erfolgreich. Ursache: (408)
](http://fritz.box/help/help.lua?sid=fe6d615b17ca9d6c&helppage=hilfe_syslog_78.html)[
19.01.22
14:28:11
Anmeldung der Internetrufnummer 3000 war nicht erfolgreich. Ursache: Gegenstelle antwortet nicht. Zeitüberschreitung.
](http://fritz.box/help/help.lua?sid=fe6d615b17ca9d6c&helppage=hilfe_syslog_73.html)

That implies you are new to Asterisk, in which case you should not be using chan_sip which is effectively unsupported and will be removed next year.

This means the destination device has failed to register. 3000 would appear to be the only device that can register.

This relates to a local sound card driver. You have not provided anything that explains why you are trying to access that driver.

You are not being consistent in your naming of this option. This is the deprecated name but you used the current name elsewhere.

insecure=invite is not a particularly sensible thing to combine with host=dynamic. As its name implies, it reduces security, but I can think of no case where that is necessary. Putting port as well suggest that you copied this from a questionable example.

Many thanks! I deleted the mentioned parts in the sip.conf:

I have not used chan_sip on purpose, I just installed from source without changing anything. Is there anything to replace chan_sip? How should I do that?

Here is how I installed:

sudo apt update
sudo apt -y upgrade
sudo reboot

apt-get install build-essential
apt-get install openssl libxml2-dev libncurses5-dev uuid-dev sqlite3 libsqlite3-dev pkg-config libjansson-dev

cd /usr/src/

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz

tar xvf asterisk-16-current.tar.gz
cd asterisk-16*/

sudo contrib/scripts/install_prereq install

Ausgabe:

#############################################
## install completed successfully
#############################################

./configure

Ausgabe:


configure: Menuselect build configuration successfully completed

               .$$$$$$$$$$$$$$$=..     
            .$7$7..          .7$$7:.   
          .$$:.                 ,$7.7   
        .$7.     7$$$$           .$$77 
     ..$$.       $$$$$            .$$$7
    ..7$   .?.   $$$$$   .?.       7$$$.
   $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
 .777.   .$$$$$$77$$$77$$$$$7.      $$$,
 $$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7
$$$       .7$$$$$$$$$$$$$$$$      :$$$.
$$$       $$$$$$7$$$$$$$$$$$$    .$$$. 
$$$        $$$   7$$$7  .$$$    .$$$.   
$$$$             $$$$7         .$$$.   
7$$$7            7$$$$        7$$$     
 $$$$$                        $$$       
  $$$$7.                       $$  (TM)     
   $$$$$$$.           .7$$$$$$  $$     
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$     
       $$$$$$$$$$$$$$$$.               

configure: Package configured for:
configure: OS type  : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :

make
make install
make samples
make config
ldconfig

Rechte setzen:

sudo groupadd asterisk
sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk
sudo usermod -aG audio,dialout asterisk
sudo chown -R asterisk.asterisk /etc/asterisk
sudo chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
sudo chown -R asterisk.asterisk /usr/lib/asterisk

Asterisk als user setzen.

$ sudo nano /etc/default/asterisk

AST_USER="asterisk"
AST_GROUP="asterisk"

$ sudo nano /etc/asterisk/asterisk.conf

runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.

sudo systemctl restart asterisk
[3000]
 type=friend
 username=3000
 host=dynamic
 secret=mysecret

Now fritzbox says the device is registered, but I still cannot make calls from asterisk.
I have not configured anything to use the sound card driver. I can only imagine it does not work because asterisk is running in a linux container withouth access to the files on the host.

I now get the following message:

*CLI> console dial 3000
[Jan 19 15:53:42] WARNING[480]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Jan 19 15:53:42] NOTICE[480]: console_video.c:136 console_video_start: voice only, console video support not present
[Jan 19 15:53:42] NOTICE[445][C-00000001]: chan_sip.c:24409 handle_response_invite: Failed to authenticate on INVITE to '"asterisk" <si                   p:asterisk@10.184.175.249>;tag=as154791c8'
[Jan 19 15:53:43] WARNING[732][C-00000001]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Jan 19 15:53:44] WARNING[732][C-00000001]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory

And I also cannot make a call to asterisk. There is no message in asterisk, just the fritzbox says the call cannot be made.

It looks as though Asterisk isn’t registered with the fritzbox, because its user name or password is wrong.

Also you device naming is confusing. I assume the fritzbox is connecting through to the PSTN, but why do you call it 620?

type=friend is rarely a good idea.

chan_sip has been replaced by chan_pjsip, and, in fact, if you are using a recent version of Asterisk, you will need to go out of your way to get chan_sip to build and load.

You should generally run with verbose set to 5 when doing this sort of debugging.

Many thanks!

was/is already set.

What do you mean by “go out of your way”? How can I replace chan_sip? Do I have to reinstall and if so, from which source? It seems to me I currently downloaded the newest version of asterisk. I havent used chan_sip on purpose.

Yes, seems so. But first my fritzbox says the phone is connected properly. PW and login already checked. Only after some minutes, it changes to not connected. Probably it is a problem with the fritzbox.

Your build shows you are using Asterisk 16. Altough that is still supported, until Autumn next year, the latest version is 19 and the latest long terms stable version is 18.

Out of your way means that you have to explicitly enable building chan_sip in menuselect and that you have to remove the noload line for chan_sip in modules.conf.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.