ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Storing Elastix 2 Call Recordings on NFS NAS Share

    IT Discussion
    elastix elastix 2 elastix 2.4 voip pbx nas nfs linux
    3
    32
    11.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      A common modification to a PBX is to store call recordings someplace other than on the PBX itself. This allows the PBX to remain essentially stateless (logging needs to go elsewhere, too) and lets storage be kept at a different priority tier. Very useful.

      The best approach to this is simply replacing the call recording folder with an NFS mount from a NAS or fileserver. NFS works transparently for us here and is definitely the best choice. SMB, iSCSI and other options do exist, of course, but are not as ideal. Stick with NFS when possible.

      Your NFS server needs matching asterisk credentials and permissions in both places in order for the Asterisk user to be able to write to the space.

      By default, Elastix is going to store call recording files in /var/spool/asterisk/monitor. So we need to move this directory out of the way before we can continue. Be sure that Asterisk is not writing into this while you do this or you can cause problems. So stop Asterisk before beginning this process.

      /etc/init.d/asterisk stop
      mv /var/spool/asterisk/monitor /var/spool/asterisk/monitor_old
      

      This gets our old folder out of the way and guarantees that it is not being used. Now we just need to mount our NFS server where this folder used to be.

      We need to start by adding the proper line into /etc/fstab to do this. You will need to alter the configuration file to reflect the information from your NFS share:

      echo 'server:/share/name /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr' >> /etc/fstab
      mkdir -p /var/spool/asterisk/monitor
      mount /var/spool/asterisk/monitor
      /etc/init.d/asterisk start
      

      If all is well, you should be back up and running at this point.

      1 Reply Last reply Reply Quote 4
      • scottalanmillerS
        scottalanmiller
        last edited by

        Adding @poorizad to this thread.

        poorizadP 1 Reply Last reply Reply Quote 0
        • poorizadP
          poorizad @scottalanmiller
          last edited by

          @scottalanmiller sorry , i got this :

          [root@localhost ~]# echo '192.168.101.11:/volume1/call recordings /var/spool/ast erisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr' >> /etc/fstab
          [root@localhost ~]# mount /var/spool/asterisk/monitor
          [mntent]: line 8 in /etc/fstab is bad
          mount: can't find /var/spool/asterisk/monitor in /etc/fstab or /etc/mtab
          [root@localhost ~]# echo '192.168.101.11:/volume1/Call Recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr' >> /etc/fstab
          You have new mail in /var/spool/mail/root
          [root@localhost ~]# mount /var/spool/asterisk/monitor
          [mntent]: line 8 in /etc/fstab is bad
          [mntent]: line 9 in /etc/fstab is bad
          mount: can't find /var/spool/asterisk/monitor in /etc/fstab or /etc/mtab

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller @poorizad
            last edited by

            @poorizad Whoops, we forgot the mount point creation. Before running the mount command do this:

            mkdir /var/spool/asterisk/monitor
            
            poorizadP 1 Reply Last reply Reply Quote 0
            • poorizadP
              poorizad @scottalanmiller
              last edited by

              @scottalanmiller i got this error:
              mount:cant find /var/spool/asterisk/monitor in /etc/fstab or /etc/mtab

              here is my code:
              /etc/init.d/asterisk stop
              mv /var/spool/asterisk/monitor /var/spool/asterisk/monitor_old

              echo '192.168.101.11:/volume1/Call Recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr' >> /etc/fstab
              mkdir /var/spool/asterisk/monitor
              mount /var/spool/asterisk/monitor
              /etc/init.d/asterisk start

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller
                last edited by

                Let's see what got put into the file... what is the output of this...

                cat /etc/fstab
                
                poorizadP 1 Reply Last reply Reply Quote 0
                • poorizadP
                  poorizad @scottalanmiller
                  last edited by

                  @scottalanmiller said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                  cat /etc/fstab

                  /dev/VolGroup00/LogVol00 / ext3 defaults 1 1
                  LABEL=/boot /boot ext3 defaults 1 2
                  tmpfs /dev/shm tmpfs defaults 0 0
                  devpts /dev/pts devpts gid=5,mode=620 0 0
                  sysfs /sys sysfs defaults 0 0
                  proc /proc proc defaults 0 0
                  /dev/VolGroup00/LogVol01 swap swap defaults 0 0
                  192.168.101.11:/volume1/call recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr
                  192.168.101.11:/volume1/Call Recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr
                  192.168.101.11:/volume1/Call Recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr
                  192.168.101.11:/volume1/Call Recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr
                  You have new mail in /var/spool/mail/root

                  scottalanmillerS 2 Replies Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller
                    last edited by

                    You can't run that echo command more than once or you need to manually clean it up.

                    poorizadP 1 Reply Last reply Reply Quote 0
                    • poorizadP
                      poorizad @scottalanmiller
                      last edited by

                      @scottalanmiller how 😄

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @poorizad
                        last edited by

                        @poorizad said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                        192.168.101.11:/volume1/Call Recordings /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr

                        Here is the problem, you put a space into a share name. Never use spaces in names, ever. Not in hostnames, file names, share names, nothing. Computers and spaces don't go together. It doesn't exactly break things... but it breaks things. Working in IT you should simply never have spaces or capitals in any kind of name, make that a habit now. It will save you countless sorrows in your career.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @poorizad
                          last edited by

                          @poorizad said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                          @scottalanmiller said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                          cat /etc/fstab

                          /dev/VolGroup00/LogVol00 / ext3 defaults 1 1
                          LABEL=/boot /boot ext3 defaults 1 2
                          tmpfs /dev/shm tmpfs defaults 0 0
                          devpts /dev/pts devpts gid=5,mode=620 0 0
                          sysfs /sys sysfs defaults 0 0
                          proc /proc proc defaults 0 0
                          /dev/VolGroup00/LogVol01 swap swap defaults 0 0
                          192.168.101.11:"/volume1/Call Recordings" /var/spool/asterisk/monitor nfs rsize=8192,wsize=8192,timeo=14,intr

                          Manually edit the /etc/fstab file to look like this. Notice that there is only one line for the NAS mount and the share name is in quotes now. White space denotes different columns in configuration files so having spaces in names means you have to escape them somehow.

                          1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller
                            last edited by

                            I only use vi to edit files, but it is pretty tough to learn for the first time. Lots of people recommend nano for new users, but I've never used it so am not very helpful.

                            poorizadP 1 Reply Last reply Reply Quote 0
                            • poorizadP
                              poorizad @scottalanmiller
                              last edited by

                              @scottalanmiller
                              ok i create another sharedfolder with nfs call: callrec
                              now i have to manually edit /etc/fstab ? and change the call recordings to callrec first?

                              scottalanmillerS 1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller @poorizad
                                last edited by

                                @poorizad said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                                @scottalanmiller
                                ok i create another sharedfolder with nfs call: callrec
                                now i have to manually edit /etc/fstab ? and change the call recordings to callrec first?

                                Correct

                                poorizadP 1 Reply Last reply Reply Quote 0
                                • poorizadP
                                  poorizad @scottalanmiller
                                  last edited by

                                  @scottalanmiller really thx scott....sorry i bother you too much....imagine a guy with no linux background want do this :)))
                                  now everything seems fine. and i saw the mount folder in df command.....
                                  now how can i make sure its work? i meane how can i test the linux credential to copy files into that folder

                                  1 Reply Last reply Reply Quote 1
                                  • scottalanmillerS
                                    scottalanmiller
                                    last edited by

                                    You are not bothering me at all, we are all here to help each other. And for a Linux newbie, you are doing great. This isn't a tough task, but it isn't a trivial one either and you are flying right through it!

                                    1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller
                                      last edited by

                                      Easiest thing to do is to become the asterisk user and just make a file there. So try this...

                                      su - asterisk
                                      touch /var/spool/asterisk/monitor/mytestfile
                                      

                                      Then you can see if it is there...

                                      cd /var/spool/asterisk/monitor
                                      ls
                                      
                                      poorizadP 1 Reply Last reply Reply Quote 0
                                      • poorizadP
                                        poorizad @scottalanmiller
                                        last edited by

                                        @scottalanmiller said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                                        cd /var/spool/asterisk/monitor

                                        yes its ok .
                                        how can i copy monitor_old to monitor now ?

                                        scottalanmillerS 1 Reply Last reply Reply Quote 0
                                        • scottalanmillerS
                                          scottalanmiller @poorizad
                                          last edited by

                                          @poorizad said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                                          @scottalanmiller said in Storing Elastix 2 Call Recordings on NFS NAS Share:

                                          cd /var/spool/asterisk/monitor

                                          yes its ok .
                                          how can i copy monitor_old to monitor now ?

                                          Okay, once all good you can just do this...

                                          cp -rp /var/spool/asterisk/monitor_old/* /var/spool/asterisk/monitor/
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller
                                            last edited by

                                            Depending on the size of the file and the speed of the network and the NAS, this might take a few seconds or a bit of time. This is a full copy of the data over the network.

                                            poorizadP 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post