Author Message
cmarion
Joined: Oct 13, 2022
Messages: 2
Offline
I've using this method to list informations of the phones (for a web site developping in PHP)
https://<server IP>:<server port>/inyama/service/logicaldevice/getForwarding

My algorithm :
- open session avaya
- for all phone (X = 1 : 10)
Getforwarding (phone X)
print (fwdTo for phone X)
- close session

The response of the API is HTTP 202 Accepted
But I have not the response for phone X , i can have twice response for the same phone

exemple of response :
{"ns3_telephonyPresenceEvent":{"telephonyPresence":{"forDevice":"201618","stateUnknown":"false","canPickup":"false","ringing":"false","onhook":"true","online":"false","dndon":"false","inservice":"true","fwdon":"false","fwdTo":{}}}

for example :
GetForwarding (phone 201618) => response for phone 201829
GetForwarding (phone 201829) =>response for phone 201732
GetForwarding (phone 201732) =>response for phone 201829

I change my algorithm to open and close session for each Getforwarding : I have the good response but the page who I print informations is too long (15 seconds for only 10 phones).

have you a idea why my first algorithm is not OK ?
or how I can developp this ?

tks
JohnBiggs
Joined: Jun 20, 2005
Messages: 1139
Location: Rural, Virginia
Offline
It is not clear from your psuedo code if you wait for a response in your getforwarding(phone X) step.

Given http is asynchronous protocol, from my perspective the reordering of request versus arrival of responses you show makes some sense. You could use separate threads (one per session), but that doesnt scale particularly well, or you could re-order the responses within your application since the device extension is in the response.
cmarion
Joined: Oct 13, 2022
Messages: 2
Offline
I tried to wait 1 second for each call of GetWorwarding but I had the same problem.

I can't re-order all responses because I have not all responses for all phone.
For ex, with a step of 3 phones, I have 2 responses for the same phone. For one phone I have never the good response.
Go to:   
Mobile view