How to use external SIP client for advanced features
This article describes how to setup an IMS environment to answer call from UE with an audio file or play RTT.
Table of Contents
- Use PJProject as SIP client
- Configure IMS for pjsua SIP client
- How to answer a MO call with an audio file
- Trigger an MT call
- How to setup RTT
Use PJProject as SIP client
First step is to build pjproject with AMR codec support.
pjproject sources are available hereHere and build instructions < href="https://docs.pjsip.org/en/latest/get-started/posix/build_instructions.html">here.
On Fedora, you may just install opencore AMR codecs with dnf:
And then build the default way:
NB:when building pjproject, you may have errors and need to install dev packages (alsa, ffmpeg).
After installing packages, start building from scratch (from ./configure).
Configure IMS for pjsua SIP client
When running pjsua SIP client, you need it to register to IMS.
We assume that you use default ims.cfg configuration file.
Add the following entry in your ue_db (ue_db-ims.cfg):
How to answer a MO call with an audio file
Convert audio file to wav to use with pjsua
The pjsua SIP clients requires a 16bits mono wav file.
To create it from any audio format use the following command line:
It will generate a test.wav file that will be used in next step.
Run pjsua SIP client
After building pjproject, you should find the pjsua SIP client under pjsip-apps/bin/pjsua-x86_64-unknown-linux-gnu pjproject sources subdirectory.
Create the following text file as pjsua.cfg:
Start pjsua
Your IMS server must be running (and thus your MME).
Launch the following command:
It assume your are under pjproject source directory and you have copied your test.wav audio file and pjsua.cfg config file there.
Of course you can change the path if needed.
Once started, the pjsua SIP client should be registered.
You can check it by typing users in IMS CLI with the following result:
Place a call
All you have to do right now is placing a call with 1234 as phone number from your VoLTE client.
You should here your audio file played.
Trigger an MT call
From pjsua command line interface you may call a UE the following way:- Type m
- Enter sip:<impu>@<IMS IP address>
How to setup RTT
Client defined for audio call can be adapted to enable RTT. You may add the following option to your config file:
Beyond
Take a look at pjsua configuration, you may find a way to record calls or advanced features.
Start PJSUA as a service linked to LTE
Create a pjsua.sh file with execution permissions and following content:
Create a pjsua.service file with following content:
NB: change path of ExecStart in pjsua.service (Must be an absolute path).
NB: Those two files should be placed at same location as audio file and pjsua config file.
NB: You may change the User parameter of pjsua.service if you have not done first steps of this page as root.
Then execute the following commands as root:
Now, pjsua will be started and stopped automatically depending on LTE service state.
Note that it is launched in a separate screen instance called PJSUA. You may access it via: