Is there an execute api of read in Freeswitch? - freeswitch

I have gone thru the Freeswitch API document and what I am looking for is a javascript API which is to replace the read action in my dialplan.
If I do not use javascript, the code will be like below:
<action application="read" data="4 4 /usr/share/freeswitch/sounds/en/us/callie/conference/8000/pin-number.wav conference_pin_input 10000 #" />
I have found other APIs, like
<action application="hangup">
in javascript is session.hangup() and so on.
Currently I have gone thru the two documents which are https://freeswitch.org/confluence/display/FREESWITCH/Session+Execute and https://freeswitch.org/confluence/display/FREESWITCH/JavaScript+API+Reference, but I think the document is quite poor, lots of things that we want need to read the source code. Can I please ask whether there is a javascript API to read the user input from dtmf?

I believe you can still use that application from session.execute():
session.execute('read', '4 4 /usr/share/freeswitch/sounds/en/us/callie/conference/8000/pin-number.wav conference_pin_input 10000 #');

Related

Using Pinterest Marketing api to fetch all entities?

Is there an edge that would allow fetching all the campaigns, adgroups, etc., of a given advertiser? In researching this I see these:
GET /ads/v3/campaigns/{campaign}/
GET /ads/v3/adgroups/{adgroup}/
...
which return only single entities. I also found that there is an async report that returns entities in batch:
advertisers/<advertiser ID>/entities/batch/
Is this the best way to accomplish this? If so, the doc says it only supports campaigns right now, is that still the case?
Thanks
Sorry to waste your time folks, I've since found more and better doc and discovered that there is this:
/ads/v3/advertisers/{advertiser}/campaigns/
Here is a link to the doc for your own reference:
https://developers.pinterest.com/docs/redoc/#operation/ads_v3_get_advertiser_campaigns_handler_GET

Interpreting where I would find the output files in Magento - templates

I am a few weeks into using Magento, and this is a URL for which I'm trying to track the output file (I believe it would be a .phtml file):
http://mytest.shopland.com/smi130495/catalog/category/view/s/his-jewelry/id/312834/
the first parameter smi130495 is the store parameter, and obviously the last two are a name-value pair for the category. I'm pretty sure we have NOT touched core, so there might be files in local. However I'm also aware that there is a skin folder. Does anyone have a suggestion of how to interpret it? Thanks.
It would probably help you a lot to read an article about how Magento routing works, but I will explain briefly what your URL means:
smi130495: As you stated, this is your store code. Since Magento can support multiple tiers of websites/stores, this is an optional piece that depends on your setup.
catalog/category/view: This is the routing information (module, controller, action). This gets translated into a dispatch of Mage_Catalog_CategoryController::viewAction() found in the file app/code/core/Catalog/controllers/CategoryController.php.
s/his-jewelry: You are correct that this is where the params begin. This looks like a search term being passed from search results.
id/312834: This is the category ID that will be loaded by the dispatched controller action.
Knowing this information is the first clue to finding the code that will be used to create your output, but there is much more that goes into the rendering of the final output. It would be too long to explain everything here that can impact output since, for example, Magento uses an intermediate XML-based layout layer of “blocks” that in turn make use of templates to render specific pieces of content on the page.
However, I can point you to the main template for your route app/design/frontend/$package/$theme/template/catalog/category/view.phtml, which gets added to the layout like this in app/design/frontend/$package/$theme/layout/catalog.xml:
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
</reference>
Hope that helps you some.
In Magento .phtml files are inside :
Admin panel files : app/design/adminhtml/default/default/template
Frontend files : /app/design/frontend/default/{theme name}/template
Like in query you are searching for category/view file
app/design/frontend/default/{theme name}/template/catalog/category/view.phtml
To make life easier, you can use several tools. Finding Templates in Magento sometimes is alot of work. Template Hints are a good way to find templates quicker. You can enable template-hints in the Magento backend in the Configuration under System->Development. In case you want a better solution with template hints, you can use this module from AOE:
https://github.com/AOEpeople/Aoe_TemplateHints
Hope this helps, regard, David

How do I get a count of the Shopify products in a collection using the Ruby API

I want to get the count of products in each collection in the shop as part of a Shopify App that I'm building.
I know that for a single collection Product.all(params: {collection_id: 29238895}).count will show me the count in the shopify console, but I'm not certain about how it is implemented.
The API document describes a call that counts all products that belong to a certain collection GET /admin/products/count.json?collection_id=841564295 but I have been unable to get a ruby expression that runs this.
Is there a more complete document on the Ruby API?
If you want to know exactly what is going on with the API, may I suggest the simple command: bundle open shopify_api
That will load the entire API into your text editor, allowing to quickly determine the answer to your question. The /lib/resources directory is especially rich, but do not forget to check the base class as well. In fact, I think the count option is declared right in the base itself. Nothing beats a few minutes of examining the code.

Call Recording in Freeswitch

I have a freeswitch working on one server and call is working fine.
But now i want to record each and every call to some specific format like .wav OR .gsm
I already tried with "record_session" application.Record session application
Is it right application for record call ?
If yes then please suggest me to some example and if not then suggest me other application also.
This question is old but I'll still answer it for the people who could benefit in future.
record_session will record the entire session including the ringing. If you just want to record the conversation use execute_on_answer=record_session followed by complete file path, like so:
<action application="export" data="execute_on_answer=record_session $${base_dir}/recordings/${strftime(%Y%m%d%H%M%S)}_${caller_id_number}.wav"/>
You can record a call by adding the command below into the dialplan:
<action application="record" data="/tmp/data.wav 20 200"/>
The format of this is record,Record File,<path> [<time_limit_secs>] [<silence_thresh>] [<silence_hits>] with time_limit_secs, silence_thresh, silence_hits all being optional.
Refer the FreeSWITCH wiki for more details.
https://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_record
EDIT: As #hdiogenes pointed out, this records like a voicemail. What you OP is looking for is the application record_session.
https://freeswitch.org/confluence/display/FREESWITCH/record_session

Easiest way to display location?

What is the most up to date, accurate, turn-key code to inject into a page to automatically read a user's IP and spit out their city... on this page we are borrowing from goingtorain.com I want it to display ... within 3 miles of (dynamic city)
http://www.drillavailable.neighborrow.com/
Another one we've been looking at to use is http://www.maxmind.com/app/geolitecity. Looks to be fairly simple to setup and is open source/free with apis for most popular languages.
Not done much other than play with it for 5 mins but looks promising.
I'd go with location aware browsing. Look into the W3C GeoLocation API.
For example, try Google Gears Geolocation module.
These technologies allow your clients to be geolocalized not only by looking and their IP (which can have 200km offsets) but also by triangulating SSID information from nearby wireless Access Points, and this can be extremely precise.
Once you have the (lon,lat) coordinates, it's just a matter of calling some webservice to get the nearest city's name.
I would choose the locator API at http://ipinfodb.com You can access it via XML or JSON, send it your API key and an IP and it will return the city, state, zip, country, etc. You can then parse the results in your language of choice. Its the simplest way to achieve this without actually storing any information about IP/location routing.
Yes, you only need to use the ClientLocation object in the google.loader namespace. In total the whole code is.
<script src="http://www.google.com/jsapi" language="javascript"></script>
<script language="javascript">
if (google.loader.ClientLocation != null) {
alert(google.loader.ClientLocation.address.city);
} else {
alert("Not found");
}
</script>
The properties available are
google.loader.ClientLocation.latitude
google.loader.ClientLocation.longitude
google.loader.ClientLocation.address.city
google.loader.ClientLocation.address.country
google.loader.ClientLocation.address.country_code
google.loader.ClientLocation.address.region

Resources