device types in CreateAsyncFind function of UPnP - visual-c++

Please tell me what is range of values I can give in device type parameter of CreateAsyncFind() function. How it detects the devices basis on string given ???
Thanks in Advance !!!

Each UPnP device has its own unique type and URI, you will need to supply the URI in your call to CreateAsyncFind(). As an example to search for a MediaServer:3 device you would use urn:schemas-upnp-org:device:MediaServer:3.
Checkout Device Categories for a list of different device categories.

Related

Best way to validate DICOM connection request with pynetdicom

What is the preferred way to validate requested DICOM connection against a list of known hosts?
I can connect to the EVT_CONN_OPEN event. But in that, the event.assoc.requestor.info.ae_title element is always empty (b'').
I see from a TCP network analysis, that the name is transmitted. So, where is it?
What is the right way to validate the requesting host?
You could try using EVT_REQUESTED instead, it gets triggered after an association request is received/sent and the AE title information should be available at that point. Unfortunately EVT_CONN_OPEN is triggered on TCP connection which occurs prior to the association request.
If you don't like the host's details you can use the handler to send an association rejection message using event.assoc.acse.send_reject() or abort with event.assoc.abort().
If you're only interested in validating against the AE title you can use the AE.require_calling_aet property to restrict associations to those with matching AE titles.
For the benefit of anyone else looking this up, the correct stage to look this up is in the EVT_REQUESTED event. However you will likely find the details aren't filled in (they are populated AFTER the handler has been called).
So if you want to locate the callers AE in EVT_REQUESTED, you need to locate the A_ASSOCIATE primitive and read them from there. So for example in your handler you can do this to reject remotes:
def handle_request(event):
req_title = event.assoc.requestor.primitive.calling_ae_title.decode('ascii')
if req_title != 'MyAET':
event.assoc.acse.send_reject(0x01, 0x01, 0x03)
return
At least for 1.5.7.

How to get values for ipi_ifindex for sendmsg()?

Using sendmsg() it is possible to specify from which interface a datagram will be sent, if a value is set for in_pktinfo.ipi_ifindex.
If the packet is a response to a datagram received with recvmsg() I can get the interface value from there.
If I just know that the interface if 'eth0' or 'eno1', how can I look up the corresponding `in_pktinfo.ipi_ifindex' value?
Use if_nametoindex() to convert the interface name to an index.
if_indextoname() does the reverse.

Getting arguments/parameters values from api.ai

I'm now stuck on the problem of getting user input (what user says) in my index.js. For example, the user says: please tell me if {animals} can live between temperature {x} to {y}. I want to get exact value (in string) for what animals, x and y so that I can check if it is possible in my own server. I am wondering how to do that since the entities need to map to some exact key values if I annotate these three parameters to some entities category.
The methods for ApiAiApp is very limited: https://developers.google.com/actions/reference/nodejs/ApiAiApp
And from my perspective, none of the listed methods work in this case.
Please help!
Generally API.AI entities are for some set of known values, rather than listening for any value and validating in the webhook. First, I'd identify the kinds of entities you expect to validate against. For the temperatures (x and y), I'd use API.AI's system entities. Calling getArgument() for those parameters (as explained in the previous answer) should return the exact number value.
For the animals, I'd use API.AI's developer entities. You can upload them in the Entity console using JSON or CSV. You can enable API.AI's automated expansion to allow the user to speak animals which you don't support, and then getArgument() in webhook the webhook will return the new value recognized by API.AI. You can use this to validate and respond with an appropriate message. For each animal, you can also specify synonymous names and when any of these are spoken, and getArgument() will return the canonical entity value for that animal.
Extra tip, if you expect the user might speak more than one animal, make sure to check the Is List box in the parameter section of the API.AI intent.
If "animals", "x", and "y" are defined as parameters in your Intent in API.AI, then you can use the getArgument() method defined in ApiAiApp.
So the following should work:
function tempCheck( app ){
var animals = app.getArgument('animals');
var x = app.getArgument('x');
var y = app.getArgument('y');
// Check the range and then use something like app.tell() to give a response.
}

Live call transfer by using asterisk

i want to transfer a call from first executive to second executive when customer call to first executive by mistake? How first executive can map customer to second executive by pressing a key by using asterisk technology?
Default transfer is *2. For exact code check features.conf
You also have dialplan Transfer application you can map on any other extension.
You have Transfer ami command usable via asterisk managment interface(AMI)
The question is a bit vague, but since you put freepbx on the tags, I suppose you are using freepbx generated dialplan.
If I understand well, when a certain inbound context calls executive1 you want
1) them to be automagically redirected on executive2 before executive1 answers
or
2) executive1 answers, realizes that call is wrong and blind-transfers call to executive2 pressing a single button (= DTMF).
CASE 1 - Automatic redirection
Edit your /etc/asterisk/extension_custom.conf
[your inbound context]
exten => <executive 1 number>,Goto(your inbound context, executive2 number, 1)
You can find the name of your inbound context in the freepbx automatic generated dialplan, or in the freepbx GUI
CASE2 - In call transfer
Refer to this post to define a new feature code for in-call transfer. Unfortunately your feature code will be likely some #digit
Associate the application
Goto(your inbound context, executive2 number, 1)
to the feature code
Hope this will help.

What is the "interfaceId" referring to in chrome.usb.findDevices() and chrome.usb.requestAccess()?

I'm trying to get a USB device to work on ChromeOS, and I'm running into an issue. From what I understand, I need to do this for the device I'm trying to utilize:
chrome.usb.requestAccess(Device device, integer interfaceId, function callback)
or, I can use:
chrome.usb.findDevices(Device device, function callback)
Whichever one I choose, I need to provide the interfaceId (as part of the device tuple in findDevices, or as the second parameter in requestAccess)
https://developer.chrome.com/apps/usb#method-findDevices
vendorId
productId
interfaceId (The interface id to request access against. Only available on ChromeOS. It has no effect on other platforms.)
I cannot find any documentation regarding this anywhere -- and nothing I try seems to work.
I was confused too and then I found the answer in the specifications of the function:
integer (optional) interfaceId
Since Chrome 29. The interface ID to request access to. Only available on Chrome OS. It has no effect on other platforms.
Referred to: https://developer.chrome.com/apps/usb#method-findDevices

Resources