Installing srtp on Centos

You can be forgiven if you don’t know what srtp is. It is a secure version of rtp, which is the protocol most often used to carry voice traffic across data networks. VOIP also uses a signalling protocol like SIP to establish and terminate sessions, but rtp/strp transports it.

I became interested in this protocol following the release of Asterisk 1.8, a software pbx system which I run at home. I’m rebuilding my linux platform to make it more robust (right now because I’ve improperly installed things from source, yum no longer works on my current server), and decided to include srtp in the build.

The package is install in source form from a tarball, and installs in the usual way (./configure followed by make). Once you run make, the documentation recommends that you run make runtest to test the functionality before installing using make install. Unfortunately, on Centos 5.6 at least, this test failed with error 254, command not found, at line 27 of test/rtpw_test.sh.

It turned out that this script tried to define a symbol for the strp executable, rtpw, using the command RTPW=rtpw. This doesn’t work. I changed the line to RTPW=./rtpw, and the script ran fine and reporting that the tests passed.

One of my colleagues believes that some programmers of open source software leave little traps like this to ward off the incompetent but in this case I’m not sure. Certainly having to dig into the script caused me a fair amount of trouble, mostly because of the 2-3 hours of Google searching I did to see if anyone else had experienced the same problem. Strangely, I saw no evidence of that, and hopefully this post will inform anyone who treads the same path.

The other trick was that I had to run ./configure CFLAGS=-fPIC to make the srtp library shareable. Asterisk ./configure complains if you don’t. Note: Don’t forget the hyphen as in -fPIC!

Advertisements

About Chris Sullivan

Vice-President, Finance & Operations, IDC Canada. PADI Master Scuba Diver Trainer and Technical Diver.
This entry was posted in Google, Linux, Open Source, VOIP and tagged , , , , . Bookmark the permalink.

16 Responses to Installing srtp on Centos

  1. Thanx. You save me a couples hours and some damns!. Thnx again for sharing. Was stucked on runtest . So i can go ahead with my lab!.

    Best Regards!

    ivanofmg

    • Chris Sullivan says:

      Ivanof, I’m glad to be able to help you. After all the help I’ve received from blogs, forums and other web sites, and of course all the authors of open source software, it’s great to be able to contribute something myself.

      Chris

  2. spicyramen says:

    Thanks Chris, this was helpful,
    cd test; ./rtpw_test.sh >/dev/null
    ./rtpw_test.sh: line 27: rtpw: command not found
    make: *** [runtest] Error 254

    I no longer got the error after the changed you documented

  3. Mr Trọng says:

    Thanks. It Worked for me

  4. Rendika Yoga says:

    Excuse me Sir. I have followed your tutorial, but still there is an error with error code make: *** [runtest] Error 1 and without any information below whether it is safe or not sir

    • Chris Sullivan says:

      Hi Rendika,

      That’s not much information to go on. Can you post a copy of, say, 20 lines prior to the error as well?

      Chris

      • Rendika Yoga says:

        This my error Sir I’m sorry I just saw your blog ,this is sir a copy of my error
        crypto/test/cipher_driver -v >/dev/null
        crypto/test/kernel_driver -v >/dev/null
        test/rdbx_driver -v >/dev/null
        test/srtp_driver -v >/dev/null
        test/roc_driver -v >/dev/null
        test/replay_driver -v >/dev/null
        test/dtls_srtp_driver >/dev/null
        cd test; ./rtpw_test.sh >/dev/null
        2: no process found
        make: *** [runtest] Error 254

      • Chris Sullivan says:

        I’ve never seen an error like that. You could try locating rtpw_test.sh and running it manually to see what it does

  5. Thank you it also worked for me

  6. KK says:

    Hi Chris,
    I am also getting the same error like as show below

    root@asterisk srtp]# make runtest
    Build done. Please run ‘make runtest’ to run self tests.
    running libsrtp test applications…
    crypto/test/cipher_driver -v >/dev/null
    crypto/test/kernel_driver -v >/dev/null
    test/rdbx_driver -v >/dev/null
    test/srtp_driver -v >/dev/null
    test/roc_driver -v >/dev/null
    test/replay_driver -v >/dev/null
    test/dtls_srtp_driver >/dev/null
    cd test; ./rtpw_test.sh >/dev/null
    ./rtpw_test.sh: line 27: rtpw: command not found
    make: *** [runtest] Error 254
    [root@asterisk srtp]#

    As per the tutorial i run in command line
    these three commands

    [root@asterisk srtp]# RTPW=./rtpw
    [root@asterisk srtp]# RTPW=rtpw
    ./configure CFLAGS=-fPIC

    Still it doesn’t work for me.

    Request you to help me to fix the same.

    • Chris Sullivan says:

      Hi KK,

      Instead of typing the commands into the shell, please edit the file test/rtpw_test.sh and change line 27 from RTPW=rtpw to RTPW=./rtpw

      Cheers,
      Chris

      • kkprotocolin says:

        Thank you Chris,
        This worked for me. But this (RTPW=rtpw to RTPW=./rtpw) line is not in 27. It is there in some other line . I have changed the same as you said.

        Thanks again
        Krishna

      • Chris Sullivan says:

        Hi Krisha. I wrote this original post several years ago so maybe your version is different. I’m glad you managed to get it to work.

      • Yaroslav says:

        Hi
        Write, please, a command to edit the line 27

      • Chris Sullivan says:

        Hi Yaroslav, you just need to use a text editor like ed or vim to edit the file.

  7. Giraffe says:

    it worked to me too, thnx a lot for the contribution

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s