User Tools

Site Tools


vlab:o2g:intro

O2G Introduction

Alcatel-Lucent Enterprise offers a REST API for the OmniPCX Enterprise.
O2G is a scalable gateway which has a built-in docker engine to host your development as micro-services or business rules. You can find more information about O2G here.


O2G Lab architecture

Your O2G lab will have 3 virtual machines:

  • OmniPCX Enterprise (OXE) which is the main communication system.
  • OMS which is the Media Gateway for the OXE (it handles CODEC Compression, voice paths, MOH, etc..)
  • O2G which is the REST API Gateway to the OXE

Your OXE has been setup with 5 SIP Extensions. The connection information can be find in your account dashboard. The two first extensions has been setup with voicemail (which can be reach at extension 1999).

Your system is setup with a trunk loopback, which allows you to simulate outgoing/incoming calls going through a real carrier. The dialing plan is 91XXYYYZZZZ: XX and YYY being random numbers of your choice, and ZZZZ being the extension you want to call in your system.




Connect to your O2G

Your dashboard will provide you a link to connect to your O2G virtual lab. The link will allow you to access the full documentation, and will allow you to send commands to the OmniPCX.Github resources are available at this link.

In the following example, we will use the Vlab 30.
Connecting to **https://o2g-vlab30.ale-dspp.com/api/rest** will give you back a JSON page.
The value publicUrl will give you the URL to use in order to authenticate. {

"serverInfo" : {
  "productName" : "O2G Services 2.2.1",
  "productType" : "O2G",
  "productVersion" : {
    "major" : "14.2",
    "minor" : "001.004"
  },
  "haMode" : false
},
"versions" : [ {
  "id" : "1.0",
  "status" : "CURRENT",
  "publicUrl" : "https://o2g-vlab30.ale-dspp.com/api/rest/authenticate?version=1.0",
  "internalUrl" : "https://o2g-vlab30.ale-dspp.com/api/rest/authenticate?version=1.0"
} ],
"custoFeatures" : [ ]

}




Authentication

O2G uses basic HTTP Authentication: The client performs a request to initiate the authentication mechanism, the server asks for basic authentication, the client sends its credentials, the server returns an AlcUserId cookie with the public and private URL to be used in order to create a session.

Using a programming language of your own, use the public URL listed in your JSON to authenticate, with the credential you were given in your dashboard. Remember, there are plenty of tutorials available at https://github.com/ALE-OPENNESS in Python, Javascript, and PHP!

{
    "credential":   "eyJhbGciOiJIUzI1NiU1MzUyODE1NH0.RXzKVRb_cCyVtIfeq19JLJul4FCznLeGkAUxR7xp6NA",
    "publicUrl": "https://o2g-vlab100.ale-aapp.com/api/rest/1.0/sessions",
    "internalUrl": "http://o2g-vlab100.ale-aapp.com/api/rest/1.0/sessions"
}




Session

The Session service allows a user or an administrator to open a session on the O2G server.
It is a prerequisite to any service usage and must happened after the authentication stage.

Simply post a HTTP request to the public (or private if internal network) URL you got from the authentication mechanism. Don't forget to pass along your AlcSessionId and Cookie.
You will also need to send a JSON information about your application (This can be string you want):


Request:

{
	"applicationName":"FG"
}



Answer:

{
"admin": true,
"timeToLive": 1800,
"publicBaseUrl": "https://o2g-vlab100.ale-aapp.com/api/rest/1.0",
"privateBaseUrl": "http://o2g-vlab100.ale-aapp.com/api/rest/1.0",
"services": [
{
"serviceName": "Logins",
"serviceVersion": "1.0",
"relativeUrl": "/logins"
},
{
"serviceName": "Users",
"serviceVersion": "1.0",
"relativeUrl": "/users"
},
{
"serviceName": "BasicTelephony",
"serviceVersion": "1.0",
"relativeUrl": "/telephony/basicCall"
},
{
"serviceName": "Telephony",
"serviceVersion": "1.0",
"relativeUrl": "/telephony/calls"
},
{
"serviceName": "Devices",
"serviceVersion": "1.0",
"relativeUrl": "/telephony/devices"
},
{
"serviceName": "State",
"serviceVersion": "1.0",
"relativeUrl": "/telephony/state"
},
{
"serviceName": "IncomingCallbacks",
"serviceVersion": "1.0",
"relativeUrl": "/telephony/incomingCallbacks"
},
{
"serviceName": "OutgoingCallbacks",
"serviceVersion": "1.0",
"relativeUrl": "/telephony/outgoingCallbacks"
},
{
"serviceName": "Directory",
"serviceVersion": "1.0",
"relativeUrl": "/directory"
},
{
"serviceName": "EventSummary",
"serviceVersion": "1.0",
"relativeUrl": "/eventSummary"
},
{
"serviceName": "Routing",
"serviceVersion": "1.0",
"relativeUrl": "/routing"
},
{
"serviceName": "Comlog",
"serviceVersion": "1.0",
"relativeUrl": "/comlog/records"
},
{
"serviceName": "PhoneSetProgramming",
"serviceVersion": "1.0",
"relativeUrl": "/users"
},
{
"serviceName": "Subscriptions",
"serviceVersion": "1.0",
"relativeUrl": "/subscriptions"
},
{
"serviceName": "Voicemail",
"serviceVersion": "1.0",
"relativeUrl": "/messaging/mailboxes"
},
{
"serviceName": "PbxManagement",
"serviceVersion": "1.0",
"relativeUrl": "/pbxs"
},
{
"serviceName": "Analytics",
"serviceVersion": "1.0",
"relativeUrl": "/usages"
},
{
"serviceName": "Maintenance",
"serviceVersion": "1.0",
"relativeUrl": "/system"
}
]
}




Session delete

  • Simply send a DELETE request to https:/o2g-vlab100.ale-aapp.com/api/rest/1.0/sessions
vlab/o2g/intro.txt · Last modified: 2021/10/08 15:24 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki