Author Message
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Hey Gang.. I can't seem to figure out what the request body should be for requests. I'm able to create a session and delete a session.. so that's good. I'm also able to get a device registration state, so that's good. But so far, all other endpoints I call I get a 400 Bad Request. So, for the endpoint that's working, "/fe/v1/GetRegistrationState" here is what my request body looks like:


{
"device": "1234567890::nameofphonesystem:1"
}

Response:
{
"GetRegistrationStateResponse": {
"registrationState": "IDLE"
}
}


This doesn't match the example given though. Here is what the swagger page says to use, notice I have to use an extra colon between the station number and the phone system, otherwise I get a 400 Bad Request response:


{
"device": "5531:CM115:0.0.0.0:2"
}


For all other endpoints I've tried, I get a 400 regardless of how I setup the request body. I've tried:


{
"device": "1234567890::nameofphonesystem:1"
}
and
{
"device": "1234567890::nameofphonesystem"
}
and
{
"device": "1234567890:nameofphonesystem:1"
}
and
{
"device": "1234567890:nameofphonesystem"
}


All of the above json request body result in a 400 Bad Request error. The endpoints I've tried are:

/fe/v1/QueryAgentLogin (using an agentid of course)
/fe/v1/QueryAgentState (using an agentid of course)
/fe/v1/GetMessageWaitingIndicator
/fe/v1/GetPhysicalDeviceName

Any ideas as to what I may be doing wrong?

Thanks for any help!!
MartinFlynn
Joined: Nov 30, 2009
Messages: 1932
Offline
Firstly, you MUST use GetDeviceId or GetThirdPartryDeviceId to get a device ID from AES. For example:

Sending WTI request to AES using direct method: GetDeviceId
{
"deviceInstance": 3,
"extension": 50500,
"switchName": "cm181"
}
======== Incoming WTI Response =============

{"GetDeviceIdResponse": {"device": "50500:CM181:0.0.0.0:3"}}

You can then use the returned ID in further API calls:

Sending WTI request to AES using direct method: GetAgentState
{"device": "50500:CM181:0.0.0.0:3"}
======== Incoming WTI Response =============

{"GetAgentStateResponse": {
"pendingReasonCode": 0,
"workMode": "auxWork",
"talkState": "idle",
"agentStateList": {"agentStateEntry": {
"agentInfo": {"agentInfoItem": {
"agentState": "agentNotReady",
"pendingAgentState": "agentNull"
}},
"loggedOnState": true
}},
"reasonCode": 0
}}


dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Thanks for the reply Martin.. that doesn't seem to work as well. I started a session, called GetDeviceId for an agentid and I received the below response:

{
"GetDeviceIdResponse": {
"device": "1234567890::myphonesystem:1"
}
}


I then used the info from above to call "/fe/v1/QueryAgentState" and I get a 400 Bad Request using this body:

{
"device": "1234567890::myphonesystem:1"
}


I still feel like I'm missing something..

Thanks for the help Martin, I really appreciate it!
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
So I pulled the dmcc-trace logs, and I see this error when I called the "/fe/v1/QueryAgentState" endpoint:

:CstaUnMarshalerNode-3: com.avaya.mvcs.proxy.CstaMarshallerNode[334] FINEST - Returning negative ack to client session (1AC460FABD08EC91A49BDC01C7B18ADE-141) : ch.ecma.csta.errors.CstaException: org.xml.sax.SAXException: The class for the root element 'QueryAgentState' could not be found

That seems like that could be a problem?

Is there a way to check what version of WTI we have running?
MartinFlynn
Joined: Nov 30, 2009
Messages: 1932
Offline
Show me your GetDeviceId.

SSH to AES (like you did to see the logs) and run the command "swversion". Make sure you are at 10.2. Only a small number of features were implemented in 10.1.

Martin
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Hi Martin, it looks like we are on 10.2.0.0.0.190-0.. so I'm guessing that's the latest.

Thanks again,
Dave
MartinFlynn
Joined: Nov 30, 2009
Messages: 1932
Offline
Show me your GetDeviceId request.
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Here is the endpoint I use: https://aesnamegoeshere/api/fe/v1/GetDeviceId

and below is the json:
{
"deviceInstance": 1,
"extension": 1234567890,
"switchName": "aesnamegoeshere"
}

and below is the response:

{
"GetDeviceIdResponse": {
"device": "1234567890::CMName:1"
}
}
MartinFlynn
Joined: Nov 30, 2009
Messages: 1932
Offline
That doesn't look right. I think your Switch Connection may not be configured correctly on AES.

The name you put into the "switchName " field must be the same as the name of the Switch Connection that you configured on AES and you should configure it with a "PE/CLAN IP address" that is the IP address of CM. The same IP address must be added as a Gatekeeper using the "Edit Signaling Details" button.

Martin
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Oops.. sorry Martin.. I am using the switch name.. when I changed the json I accidently put aesname instead of switchname.. I did check in our aes and I'm using the name that is under: Communication Manager Interface/Switch Connections/Connection Name

Sorry for the confusion
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Hi Martin, when you say "The same IP address must be added as a Gatekeeper using the "Edit Signaling Details" button." do you know how to tell if this has been done? I'm not the one that set the AES up, and I'm not sure if it's possible to see if a Gatekeeper has already been added..
MartinFlynn
Joined: Nov 30, 2009
Messages: 1932
Offline
Using the AES web manager, click the "Communication Manager Interface -> Switch Connections" menu. Select your Switch Connection and click "Edit Signaling Details". You should see the IP address of your CM listed. If not, type it into the box and click "Add Name or IP".

Go back to the Switch Connection list and click the "Edit PE/Clan IPs" and do the same thing.

If you make any changes, you will need to restart DMCC via the "Maintenance -> Service Controller" menu.

Martin
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
Awesome! Thanks for the help Martin!! I really appreciate it!
dmorri18
Joined: May 8, 2024
Messages: 13
Offline
I just wanted to update here.. it looks like "most" of the problems I was having was because of the Gatekeeper entry being null. Once that was entered and the DMCC service restarted.. Most of the problems have gone away.. that's pretty darn cool.. thanks for your help Martin!! I appreciate it!
Go to:   
Mobile view