This little Go program first loads an SIP (Session Initiation Protocol) registrations data file. Then it exposes the data via a REST API.
- Clone this repository to your desktop
- If you have docker/docker-compose, then at the root of the repo write in a terminal :
docker-compose upgo to step #5 - If you do not have docker installed
- Run these commands (at the root of the repo):
go get -d -v ./...andgo install -v ./...andgo buildthen finally./{CHANGE_FOR_NAME_OF_THE_REPO} - Open up a browser or an HTTP client (Postman, Insomnia, etc.)
- Hit the endpoint
http://localhost/aoc/{addressOfRecord}
GET /aor/{addressOfRecord}This returns the following JSON data:
{
"addressOfRecord":"someAOR",
"tenantId":"000000-0f0f-0000-0fff-000000000000",
"uri":"sip:[email protected];jbcuser=user",
"contact":"<sip:[email protected];jbcuser=user>;methods=\"INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER\"",
"path":["<sip:[email protected]:3000;lr>"],
"source":"144.144.144.144:27015",
"target":"144.144.144.145:27016",
"userAgent":"some.domain.000",
"rawUserAgent":"SomeDomainFFF-FFF_000-UA/144.144.144.144",
"created":"2016-12-12T22:40:40.764Z",
"lineId":"000000-0f0f-0000-0fff-000000000000"
}