I am trying to use libgami in order to retrieve differentes events from Asterisk AMI. However I do not know how to parse the response that is return with this library. As the code coments say:
Returns: #GSList of status information (stored as #GHashTable) on
success, %NULL on failure
How can I get the peers out of that list? Has anyone dealt with this before?
Thanks!
Read this
http://www.voip-info.org/wiki/view/asterisk+manager+events
to see how it looks.
After that just got hash element with name as described accordinly to your event.
Related
I am running a HTTP call to bring back data in JSON format but this is bringing through an extra set of square brackets that is causing issues when i am trying to recognise the array. See screen shots.
I can remove the extra set manually in a JSON editor but need to try and find a way of doing this automatically as part of my call.
I am running the call through Integromat and have looked at using Regex but couldn't find the correct code combinations.
Any help or advise much appreciated.
You can use the replace function and insert the brackets that need to be found using regex pattern making sure you denote the bracket at the starting position and the bracket at the end of the string to be replaced with emptystring
Don't check "Parse Response" in HTTP Request module.
That way Data will be returned as long text
Use "Text Parser"'s "Replace", look for ^[|]$ and replace it with emptystring. Make sure you check "Global Match", otherwise it will only do to the first match only=[
3.Then just Parse Json from parsed(replaced) text
I think this article will help.
https://medium.com/#petr.hnilica/json-in-integromat-how-to-create-an-array-from-collections-with-the-same-structure-2991b985e03e
I am wresting to sort email messages which I got using this api
https://developers.google.com/gmail/api/v1/reference/users/messages/list
Does anybody know how gmail api send this messages?
Do they send messages in order?
Thanks
Go to Users.messages.list and Execute the Try-it. You will notice that the threadIds of messages appear in descending order with the newest one appearing on top. Also confirmed in this SO post.
I recently looked into the same issue and wrote a short python prototype - feel free to take a look, it is publicly available on Github: https://github.com/jan-janssen/pygmailsorter
As #reyanthonyrenacia already pointed out the key part is using Users.messages.list, I then combine this with Users.messages.get to receive the full message and finally add or remove the label using the Users.messages.modify action.
I want to get list algo from JSON response. In google sheet I am using this command:
IMPORTJSON("http://miningpoolhub.com/index.php?page=api&action=getminingandprofitsstatistics", "return/algo")
But I got the message "Nod not available" I think I have done something wrong with the Xpath command. How can I fix it?
How about this? I thought that / is required to be added to the top of path.
=IMPORTJSON("http://miningpoolhub.com/index.php?page=api&action=getminingandprofitsstatistics", "/return/algo")
If this was not useful for you, I'm sorry.
{
"$id":"-KMVCUSAsz92c0Hp296i",
"$priority":null,
"aQuestion":"what is your favorite color",
"option1":{"option":"red","vote":1},
"option2":{"option":"blue","vote":2},
"option3":{"option":"green","vote":0},
"option4":{"option":"yellow","vote":0}
}
So using dot notation to access this object from Firebase, using vm.data.$id and vm.data.$priority returns the correct value. However using vm.data.aQuestion or vm.data.option1 yields undefined. I've looked at several posts, however none have fixed this issue for me. Is there something simple I'm not understanding?
Okay, I think I may have figured it out. I was luckily able to find this post shortly after reading Surjeet's about something making my field null or empty.
Cannot access Firebase object attributes. Value displayed as undefined ANGULARFIRE
Because Firebase values are loaded asynchronously, the value did not load. after using vm.data.$loaded().then was I able to retrieve through dot notation. Not sure if this is the best way, but it works. Thanks everyone for your help.
Also, if anyone that reads this has a better way to go about this issue, please let me know. Thanks!
Try to see have you did something in your code which is making your object field null.
If not then,
Try this one vm.data['aQuestion']
I am trying to run the Get started with Datastore example at https://developers.google.com/datastore/docs/getstarted/start_java/ trying it both from the command line and from Eclipse.
In both environments, it is not able to connect to datastore and gives an I/O error message 'toDerInputStream rejects tag type 123'.
Looking around, this may be because the private key file is in json format and perhaps it should the p12 - other than that the error message draws a blank.
Could anyone point to something that would help me past this?
You need to use PKCS#12 format, as you said, p12. There's a few other people with similar errors (although they're trying to accomplish different things). I hope this helps, let us know if it resolves the issue.
Push Notification in Java expect p12 file
toDerInputSteam rejects tag 66