How to compile and run a next application ?

Install nodejs

Use this link for further reading

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install 22
node -v 
npm -v 


Install next

npm install -g next@latest react@latest react-dom@latest


Download next application

for Development

git clone https://github.com/hamidrhashmi/next-app.git
cd next-app
npm install
next dev -H 0.0.0.0 -p 80


For Production

npm build

or

npm run build


start Application

npm start


for troubleshooting

rm -rf .next
NEXT_PUBLIC_BUILD_DEBUG=1 next build


to run as a service

npm install pm2
pm2 start "next start" --name callhome-frontend

How to compile Google/Lyra v1 Codec ?

I have used Ubuntu 22.04 machine and followed the following instructions


Install bazel

Add Repo for Bazel. If you are using any other OS please follow the documentation

sudo apt install apt-transport-https curl gnupg -y
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
sudo mv bazel-archive-keyring.gpg /usr/share/keyrings
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list


Install bazel v5.3.2

apt update
apt install bazel=5.3.2

Install Python

Lyra codec need pytho3, numpy, and six

apt install python3 python3-pip python3-numpy python3-six unzip zip

Install JDK

Download OracleJDK version 21

wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb
dpkg -i jdk-21_linux-x64_bin.deb

Install Android Command Line Tools

Download sdkmanager

wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip commandlinetools-linux-11076708_latest.zip
mv cmdline-tools /usr/local/android-cmd


Set Envoirnmnet Variables

vim /root/.bashrc

export ANDROID_NDK_HOME=$HOME/android/sdk/ndk/21.4.7075529

export ANDROID_HOME=$HOME/android/sdk

export JAVA_HOME=/usr/lib/jvm/jdk-21.0.5-oracle-x64

export PYTHON_BIN_PATH=/usr/bin/python3


Download Android SDK/NDK

/usr/local/android-cmd/bin/sdkmanager  --sdk_root=$HOME/android/sdk --list
/usr/local/android-cmd/bin/sdkmanager  --sdk_root=$HOME/android/sdk --install  "platforms;android-30" "build-tools;30.0.3" "ndk;21.4.7075529"


Download Lyra

git clone https://github.com/hamidrhashmi/lyra.git
cd lyra
bazel sync
bazel build -c opt lyra/android_example:lyra_android_lib --config=android_arm64


If you want to create the binaries for Linux

bazel build -c opt lyra/cli_example:encoder_main --config=android_arm64
bazel build -c opt lyra/cli_example:decoder_main --config=android_arm64

Enjoy 😉

SIPp UAC Scenario to send RTP

Please install the latest sipp (>=3.7.3)

wget https://github.com/SIPp/sipp/releases/download/v3.7.3/sipp
chmor +x sipp
mv sipp /usr/bin/sipp


use the following Sipp scenario file

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!--                                                                    -->
<!--                 Sipp 'uac with pcap' scenario.                     -->
<!--                                                                    -->

<scenario name="UAC with PCAP">
  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
  <send retrans="500">
    <![CDATA[

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: B-Party <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: [cseq] INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[media_ip_type] [media_ip]
      t=0 0
      m=audio [auto_media_port] RTP/AVP 8
      a=rtpmap:8 PCMA/8000

    ]]>
  </send>

  <recv response="407" auth="true">
        <action>
                <ereg regexp="tag=([^ ]*)" search_in="hdr" header="To" check_it="true" assign_to="4,3" />
                <log message="tag is [$4], [$3]"/>
        </action>
  </recv>

  <send>
   <![CDATA[

    ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
    Via: SIP/2.0/[transport] [local_ip]:[local_port]
    From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
    To: B-Party <sip:[service]@[remote_ip]:[remote_port]>;tag=[$3]
    Call-ID: [call_id]
    CSeq: [cseq] ACK
    Contact: sip:sipp@[local_ip]:[local_port]
    Max-Forwards: 70
    Subject: Performance Test
    Content-Length: 0

   ]]>
 </send>

  <send retrans="500">
    <![CDATA[

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: B-Party <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: [cseq] INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      [authentication]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[media_ip_type] [media_ip]
      t=0 0
      m=audio [auto_media_port] RTP/AVP 8
      a=rtpmap:8 PCMA/8000

    ]]>
  </send>

  <recv response="407" optional="true">
  </recv>

  <recv response="100"
        optional="true">
  </recv>

  <recv response="180" optional="true">
  </recv>

  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
  <!-- are saved and used for following messages sent. Useful to test   -->
  <!-- against stateful SIP proxies/B2BUAs.                             -->
  <recv response="200" rtd="true" rrs="true">
        <action>
                <ereg regexp="tag=([^ ]*)" search_in="hdr" header="To" check_it="true" assign_to="1,2" />
                <log message="tag is [$1], [$2]"/>
        </action>
  </recv>

  <!-- Packet lost can be simulated in any send/recv message by         -->
  <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       -->
  <send>
    <![CDATA[

      ACK [next_url] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      [routes]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: B-Party <sip:[service]@[remote_ip]:[remote_port]>;tag=[$2]
      Call-ID: [call_id]
      CSeq: [cseq] ACK
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0

    ]]>
  </send>


  <nop>
    <action>
            <exec play_pcap_audio="./g711a.pcap"/>
    </action>
  </nop>
  <!-- This delay can be customized by the -d command-line option       -->
  <!-- or by adding a 'milliseconds = "value"' option here.             -->
  <pause/>

  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
  <send retrans="500">
    <![CDATA[

      BYE [next_url] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      [routes]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: B-Party <sip:[service]@[remote_ip]:[remote_port]>;tag=[$2]
      Call-ID: [call_id]
      CSeq: [cseq] BYE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Length: 0

    ]]>
  </send>

  <recv response="200" crlf="true">
  </recv>

  <!-- definition of the response time repartition table (unit is ms)   -->
  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>

  <!-- definition of the call length repartition table (unit is ms)     -->
  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>

</scenario>


download pcap file g711a.pcap and put it in the same directory


now start sipp script with the following command

sipp -sf uac_407.xml kamailio.hbvoice.local:5060 -s +123456789 -au sipp -ap 12345 -d 30000 -m 100 -r 1 -rp 3000 -m 10 -cid_str 14OCT24-TEST1-%u-%p@%s -min_rtp_port 20000 -max_rtp_port 25000 -base_cseq 12345


Enjoy 😉

How to compile and run a next application ?

Install nodejs Use  this  link for further reading curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash nvm inst...