UCWA 'Offline' status - invalid - skype-for-business

I trying to update my status to Offline (Skype for Business) , by POSTing
{"availability":"Offline"}
to me/presence url.
The response is: 400 Bad request
<code>BadRequest</code>
<subcode>ParameterValidationFailure</subcode>
<message>Please check what you entered and try again.</message>
<debugInfo />
<parameters>
<property name="availability">Invalid</property>
</parameters>
Same happens with 'Away' status,
but statuses like 'Online', 'Busy' work fine.

If you want to change your status to offline, the only solution I know about would be to issue a DELETE request to the application URL specific to that UCWA session. There really isn't an offline-mode for UCWA. The enumeration for Availability includes all the statuses, but sadly not an accurate description of what can/cannot be set via UCWA.
You should be able to set the following statuses:
Away
BeRightBack
Busy
DoNotDisturb
Online
Offline (as stated above) is set as a result of the application no longer existing.
IdleBusy/IdleOnline are states that the server will set when the inactivity timer is trigger in the Busy/Online states.

Related

how to make sense of People APIs responses?

When calling People API's endpoints, especially in Batch requests, we're getting many different types of error responses.
Some have useful explanation in the error message, like:
Quota exceeded for quota metric 'Daily Contact Writes (Batch requests
cost 200 quota)' and limit 'Daily Contact Writes (Batch requests cost
200 quota) per day per user' of service 'people.googleapis.com' for
consumer 'project_number:XXX'.
Which you can detect and properly handle, e.g. wait for 24 hours before retrying that request, but some are more cryptic, such as:
Resource has been exhausted (e.g. check quota).
This does mention rate-limiting, but for which quota? Is it per-user or per GCP project? When can we retry this?
Note that we're getting this for the first batch call when syncing a user account, so I'm guessing this is not per-user quota, but there's no mention of such rate-limits in the docs.
Specifically, having issues handling:
"Sync quota exceeded"
"Resource has been exhausted (e.g. check quota)"
"MY_CONTACTS_OVERFLOW_COUNT"
Here's what I have so far, feel free to edit this answer to add more insights:
Authentication or Google backend issues:
"invalid_grant": bad access token
"Insufficient Permission": access token doesn't contain required scope
"The service is currently unavailable.": Google issue
"Internal error encountered.": Google issue
"Authentication backend unavailable.": Google issue
Quota and rate-limiting:
"Sync quota exceeded": ???
"Quota exceeded for quota metric X": A specific quota had been exceeded (per min / daily will be part of the message)
"Resource has been exhausted (e.g. check quota)": ???
"MY_CONTACTS_OVERFLOW_COUNT": ???
Bad requests:
"Request contains an invalid argument": something is wrong in the request, usually a Person object with some illegal info item
"Request contains a person.etag that is different than the current person.etag": An attempt to update a person that was recently updated on Google's side, need to fetch again
"Request person.etag is different than the current person.etag": same as above
"Requested entity was not found": An attempt to update a no-longer existing person
"Contact person resources are not found": same as above
"Contact group name is empty, expected to be non empty": An attempt to create/update a group with an empty name.
"Contact group name already exists": An attempt to create a group with the same name
"MY_CONTACTS_OVERFLOW_COUNT" happens when you try to insert contacts to a google account, but they already have the maximum number of contacts.
I am not 100% sure, but this limit seems to be ~20,000 for "normal"/"free" google accounts.
edit- The limit is 25,000, since 2011: https://workspaceupdates.googleblog.com/2011/05/need-more-contacts-in-gmail-contacts.html

Braintree Sandbox Test Transaction settle() returns transaction status SETTLING instead of SETTLED

I'm following documentation for testing Braintree settlement status:
https://developers.braintreepayments.com/reference/general/testing/php#settlement-status
Doc says:
$result = Braintree_Test_Transaction::settle($sale_result->transaction->id);
$result->success
# true
$result->transaction->status
# Braintree_Transaction::SETTLED
I was testing with VISA card.
So expected result is transaction status "settled" (Braintree_Transaction::SETTLED).
Actual result is transaction status "settling" (Braintree_Transaction::SETTLING)
It's not a big deal but still I would be expecting SETTLED as stated in the documentation.
Anyone having same experience testing \Braintree\Test\Transaction::settle($transactionId) ?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
While I can't personally recreate this behavior, I could imagine the gateway returning SETTLING rather than blocking until the settlement completes. Once the settle() call has returned, you can call
Braintree\Transaction::find($sale_result->transaction->id)
and inspect the status of that transaction response object to see if the settlement has been completed.

Spring integration Error handling - How do I access original faulty message's history?

We have a spring-integration application where we would like to deal with the messages on the error channel.At a minimum we would like to extract the history and log it so we can visualise where exactly it failed etc
Here is a brief markup of just this bit
<int:poller id="defaultPoller" default="true" fixed-delay="5000" />
<int:channel id="MyCustomErrorChannel">
<int:queue capacity="10"/>
</int:channel>
<int:header-enricher id="errorMsg.HeaderEnricher"
input-channel="errorChannel"
output-channel="MyCustomErrorChannel">
<int:header name="history" expression="payload.failedMessage.headers" />
</int:header-enricher>
<int:service-activator input-channel="MyCustomErrorChannel" ref="errorLogger" method="logError"/>
<bean id="errorLogger" class="com.dataprep.util.ErrorLogger" />
The idea is to define our custom error channel MyCustomErrorChannel. Any error that ends up in the default errorChannel gets its header's enriched before being put out on MyCustomErrorChannel
Lastly we have a logger that reads the messages from MyCustomErrorChannel and logs the payload which is the underlying exception and also the history.
I notice that the history in my logger is always 3 steps
errorChannel,errorMsg.HeaderEnricher,pbSwiftRouterErrorChannel i.e nothing prior to this message landing on the errorChannel is obtainable in the history.
How do I get hold of the original message's history (i.e the history of the faulty message which somehow landed on the default error channel as a new Error Message)
Could you please take a look at my header enricher and let me know how to access the headers on the failed message and stuff it to the error message?
Is it doable at all ?
To replace existing headers you should use overwrite="true", because the history is built for the ErrorChannel, too.
You should override exactly with history header, not the whole headers. Therefore your expression must be like this:
<int:header name="history"
expression="payload.failedMessage.headers.history"
overwrite="true"/>

Bit rate error when trying to dial out to an ISDN line using Polycom XML API

I am having a problem connecting to an ISDN line using Polycom's XML API on an RMX_2000. Below is the request I am sending, and the response. I can do the same action from the RMX Manager, for the same number, in the same conference, and it works. When I trace the XML from the RMX Manager, I get an ADD_PARTY request that looks exactly like my constructed request, except with a lot more elements. I've reviewed and don't see any that seem like they could be relevant, and I am loath to manually code every single element, knowing that it is a long shot that it will even help. The same request (variant) works fine for IP and registered number requests, but no matter what I do, always get the bit rate error below. Can anyone tell me what I am doing wrong?
<TRANS_CONF_1>
<TRANS_COMMON_PARAMS>
<MCU_TOKEN>304</MCU_TOKEN>
<MCU_USER_TOKEN>304</MCU_USER_TOKEN>
<MESSAGE_ID>1</MESSAGE_ID>
</TRANS_COMMON_PARAMS>
<ACTION>
<ADD_PARTY>
<ID>18466</ID>
<PARTY>
<ID>0</ID>
<NAME>isdn</NAME>
<PHONE_LIST>
<PHONE1>12345678910</PHONE1>
</PHONE_LIST>
<INTERFACE>isdn</INTERFACE>
<CONNECTION>dial_out</CONNECTION>
<MEET_ME_METHOD>party</MEET_ME_METHOD>
<NUM_TYPE>taken_from_service</NUM_TYPE>
<MULTI_RATE>auto</MULTI_RATE>
<ALIAS>
<NAME>12345678910</NAME>
<ALIAS_TYPE>323_id</ALIAS_TYPE>
</ALIAS>
<VIDEO_BIT_RATE>automatic</VIDEO_BIT_RATE>
<ENHANCED_VIDEO>false</ENHANCED_VIDEO>
<UNDEFINED>false</UNDEFINED>
</PARTY>
</ADD_PARTY>
</ACTION>
</TRANS_CONF_1>
Here is the response:
<RESPONSE_TRANS_CONF>
<RETURN_STATUS>
<ID>1015</ID>
<DESCRIPTION>Conference bit rate must be set to a minimum of 128Kbps to enable ISDN participant connection</DESCRIPTION>
<YOUR_TOKEN1>0</YOUR_TOKEN1>
<YOUR_TOKEN2>0</YOUR_TOKEN2>
<MESSAGE_ID>1</MESSAGE_ID>
<DESCRIPTION_EX></DESCRIPTION_EX>
</RETURN_STATUS>
<ACTION>
<ADD_PARTY/>
</ACTION>
</RESPONSE_TRANS_CONF>
Thanks to a little help from someone at Polycom, I found out that the following node is required for this:
auto
I added that to the PARTY node, and now all is well.
After alot of troubleshooting and wiresharking on this error I found a combination of 2 properties being the issue
Reservation object needs
<TRANSFER_RATE>384</TRANSFER_RATE>
Party object needs
<NET_CHANNEL_NUMBER>auto</NET_CHANNEL_NUMBER>

Maximum number of messages sent to a Queue in OpenMQ?

I am currently using Glassfish v2.1 and I have set up a queue to send and receive messages from with Sesion beans and MDBs respectively. However, I have noticed that I can send only a maximum of 1000 messages to the queue. Is there any reason why I cannot send more than 1000 messages to the queue? I do have a "developer" profile setup for the glassfish domain. Could that be the reason? Or is there some resource configuration setting that I need to modify?
I have setup the sun-resources.xml configuration properties as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN" "http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd">
<resources>
<admin-object-resource
enabled="true"
jndi-name="jms/UpdateQueue"
object-type="user"
res-adapter="jmsra"
res-type="javax.jms.Queue">
<description/>
<property name="Name" value="UpdatePhysicalQueue"/>
</admin-object-resource>
<connector-resource
enabled="true" jndi-name="jms/UpdateQueueFactory"
object-type="user"
pool-name="jms/UpdateQueueFactoryPool">
<description/>
</connector-resource>
<connector-connection-pool
associate-with-thread="false"
connection-creation-retry-attempts="0"
connection-creation-retry-interval-in-seconds="10"
connection-definition-name="javax.jms.QueueConnectionFactory"
connection-leak-reclaim="false"
connection-leak-timeout-in-seconds="0"
fail-all-connections="false"
idle-timeout-in-seconds="300"
is-connection-validation-required="false"
lazy-connection-association="false"
lazy-connection-enlistment="false"
match-connections="true"
max-connection-usage-count="0"
max-pool-size="32"
max-wait-time-in-millis="60000"
name="jms/UpdateFactoryPool"
pool-resize-quantity="2"
resource-adapter-name="jmsra"
steady-pool-size="8"
validate-atmost-once-period-in-seconds="0"/>
</resources>
Hmm .. further investigation revealed the following in the imq logs:
[17/Nov/2009:10:27:57 CST] ERROR sendMessage: Sending message failed. Connection ID: 427038234214377984:
com.sun.messaging.jmq.jmsserver.util.BrokerException: transaction failed: [B4303]: The maximum number of messages [1,000] that the producer can process in a single transaction (TID=427038234364096768) has been exceeded. Please either limit the # of messages per transaction or increase the imq.transaction.producer.maxNumMsgs property.
So what would I do if I needed to send more than 5000 messages at a time?
What I am trying to do is to read all the records in a table and update a particular field of each record based on the corresponding value of that record in a legacy table to which I have only read only access. This table has more than 10k records in it. As of now, I am sequentially going through each record in a for loop, getting the corresponding record from the legacy table, comparing the field values, updating the record if necessary and adding corresponding new records in other tables.
However, I was hoping to improve performance by processing all the records asynchronously. To do that I was thinking of sending each record info as a separate message and hence requiring so many messages.
To configure OpenMQ and set artitrary broker properties, have a look at this blog post.
But actually, I wouldn't advice to increase the imq.transaction.producer.maxNumMsgs property, at least not above the value recommended in the documentation:
The maximum number of messages that a producer can process in a single transaction. It is recommended that the value be less than 5000 to prevent the exhausting of resources.
If you need to send more messages, consider doing it in several transactions.