In this example, we’ll modify the “User-Agent” header in the CANCEL SIP method to “cisco”.
This tutorial assumes you already have HOMER 7 up and running, and that your PBX is sending data to it. We are also assuming HOMER 7 is running in Docker.
Step 1: Create the lua Directory
First, create a ./lua directory in the folder where your docker-compose.yml file is located. Then, add this directory as a bind mount for the heplify-server container by adding the following code to the relevant section:
Additionally, set the following environment variables in your docker-compose.yml:
For reference, here is the updated configuration for heplify-server in docker-compose.yml:
Step 2: Create Lua Code
Now, create a file named my.lua in the newly created ./lua folder. Use the following code:
Step 3: Restart Your Containers
Restart your Docker containers to apply the changes:
Step 4: Verify
Log in to HOMER and check the CANCEL method. The User-Agent header should now be cisco. As you can see in my example, the same call is used, but the Invite has an untouched user agent LinphoneiOS/5.2.4 (iPhone) LinphoneSDK/5.3.89, while the Cancel has it changed to cisco: