This guide documents the steps to deploy an Open5GS core network with SigScale OCS for online charging, including how to configure the environment, add subscribers, and provision products for UEs.
I have extracted the code from the docker_open5gs OCS branch and edited it a bit to make it work with the latest version of SigScale OCS.
This depploys a 4G Core Network + IMS + SMS over SGs (uses Kamailio IMS).
- Docker and Docker Compose installed
- Clone of this repository
- Set your available IP addresses and UE credentials. Example UE section:
UE1_IMEI=356938035643803
UE1_IMEISV=4370816125816151
UE1_IMSI=001011234567895
UE1_KI=465B5CE8B199B49FAA5F0A2EE238A6BC
UE1_OP=E8ED289DEBA952E4283B54E88E6183CA
UE1_AMF=8000
Tip: Make sure all IPs in
.env
are available and not in use by other services.
./build_and_tag.sh
docker compose -f 4g-volte-deploy.yaml build
docker compose -f 4g-volte-deploy.yaml up
Monitor logs for successful service startup.
- Access the Open5GS WebUI (usually at
http://<WEBUI_IP>:9999
). - Add a new subscriber with the IMSI and authentication details from your
.env
. - Important:
- Set the USIM Type to
OP
(notOPc
) when using a virtual UE. - Enter the correct
KI
andOP
values.
- Set the USIM Type to
- Access the OCS UI at http://<OCS_IP>:8083.
- Add a new client/subscriber with the same IMSI.
- Add a product and assign it to the subscriber.
- Set the product's credit (e.g., bytes, cents, seconds) as needed. I had bytes and cents showing up and cents were a negative number and even though I had bytes I couldn't get it to work.
Run in different terminals:
docker compose -f srsenb_zmq.yaml up -d && docker container attach srsenb_zmq
docker compose -f srsue_zmq.yaml up -d && docker container attach srsue_zmq
- USIM Type:
Always set toOP
in Open5GS UI for Milenage authentication (notOPc
) when using a virtual UE. - Credit Control:
Ensure the OCS product assigned to the subscriber has a positive balance in the relevant bucket (e.g., bytes, cents). - Logs:
Check container logs for errors if attach or charging fails. - Network:
Make sure all containers are on the same Docker network and can reach each other.
Ensure the OCS service is exposed for UI access and uses the correct network settings:
ocs:
build: ./ocs
image: docker_ocs
container_name: ocs
env_file:
- .env
environment:
- COMPONENT_NAME=ocs
depends_on:
- smf
volumes:
- ./ocs:/mnt/ocs
- ocsdbdata:/home/otp/db
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
expose:
- "${OCS_BIND_PORT}/tcp"
- "${OCS_BIND_PORT}/sctp"
- "8083/tcp"
ports:
- "8083:8083/tcp"
networks:
default:
ipv4_address: ${OCS_IP}
Use the latest SigScale OCS image (with bug fixes):
FROM sigscale/ocs:3.4.41-1
UE1_IMEI=356938035643803
UE1_IMEISV=4370816125816151
UE1_IMSI=001011234567895
UE1_KI=465B5CE8B199B49FAA5F0A2EE238A6BC
UE1_OP=E8ED289DEBA952E4283B54E88E6183CA
UE1_AMF=8000