Call Recording in Freeswitch - 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

Related

Is there an execute api of read in 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 #');

Retrieve media Entry comments kaltura

Basically what the title says.
I can't find a relative service to their api. I have tried many ways but nothing worked so far. I'd really appreciate any help.
Thank you
You should use CuePoint service with List action and filter with KalturaCuePointFilter property EntryIdEqual - put entry's ID, which comments you want to recieve, and you will get list of all comments belonging to that entry.

Dynamic File Outbound Gateway based on header

I'd like to archive files that come in on a directory based on \name\date structure - so even every day the directory will change. Any suggestions appreciate.
I'm was on track to create a file outbound-gateway where the directory is dynamic, where the header is enriched with a method that generates the path of the directory.
I was thinking of something like this
<file:outbound-gateway id="archive" request-channel="input"
reply-channel="channel" directory="#Header[archiveLocation]}"
mode="REPLACE" delete-source-files="true">
</file:outbound-gateway>
But it doesn't seem to be the way to do it.
Based on previous related answers, I'm familiar with the samples at
https://github.com/spring-projects/spring-integration-samples/blob/master/advanced/dynamic-ftp/src/main/resources/META-INF/spring/integration/dynamic-ftp-outbound-adapter-context.xml
My concern of doing it this way is, would there be any resource issues if I need to create tens, or hundreds of different outbound-gateway?
Since I can put the data in the header, is there an easier way to do it. Or is the directory field set at context initialization, and cannot be dynamic?
Thanks
After finally creating an account on Stack Overflow all these years to post a question, found the answer later. I can use directory-expression.
<file:outbound-gateway id="archive" request-channel="input"
reply-channel="channel" directory-expression="headers.archiveLocation"
mode="REPLACE" delete-source-files="true">
</file:outbound-gateway>

Google Drive API Folder/Child ID

Does anyone knows if the google folder id changes over time? Assuming, obviously, the folder is not deleted and recreated.
I'm trying to be limit the quota usage as much as possible, by storing the ID on our side.
Thanks
UPDATE (2015/09/01) Per 'BSEs' comment below.
Sorry, I assumed it is Android (being professionally distorted).
Anyway, to make sure, look at the ID string in question and compare it with the ID you get from drive.google.com > right click > Get link. You should see something like:
https://drive.google.com/open?id=0B1mqwertyasdfghZxCvbItM0E
If the id= string matches your resource ID, you're cool. Sorry for the confusion.
ORIGINAL (incorrect for .NET, applies to GooPlaySvcs/GDAA on Android)
I believe it does.
When testing the ResourceId availability here, I remember getting DriveId in one form immediately in the 'onResult()' callback. Later, when the 'onCompletion()' event occured, the DriveId of the same object looked very different (applies to both file and folder) .
Also, look at Daniel's comment here, it suggests that you should not rely on the value of the DriveId in any moment and use 'equals()'.
The ResourceId would be more appropriate ID to store, shuttle around, etc... DriveId is useless outside the GooPlaySvcs instance. And, based on some hints from Drive-Involved-Googlers, relying on a concrete value of DriveId is dangerous. That makes existence of 'encodeToString() / decodeFromString()' somewhat questionable, right?
Good Luck

How to make wp plugin auto-refreshing on the public side of view (auto load page)

First have to say that almost every time when searching on technical solutions.. search engine will direct me to this site here. I admit that i have learned such A LOT here just by searching through for answers..
but also have to say that not being a coder.. so don't understand much here at all ;)
Ok, the Problem:
Want to update wordpress tables or calendar within wp admin. These changes should become updated on the public side automatically and more or less instantly (~ few seconds is perfectly fine).
I found solutions about manipulating header.php, i found some ajax plugins I found -too much to count- info on how to implement ajax into wp
Sadly.. none of these could help me through as the plugins mostly either not work, are outdated or require countless file edits. Manipulating header.php seems odd.. as i don't want to loop-refresh the whole page, post etc.. but only get e.g. table or calendar data updated.
So maybe any of you coders know of something to e.g. get the plugin "All-in-One Event Calendar by Timely" to update the public visible part of the calendar once data edited in wp admin?
Greatly appreciate pointers in any direction to solve this.
P.S.: What would you think of plugins like "ajaxify everything" ? don't know if this really the way to go..
Again, thanks for your help, time and contribution!!
update
additional question:
I now found such plugin to let me chose which parts i want to "ajaxify".
Such plugin would ask me for a specific function name.
Now, where do i start to gather this information?
Below is the instruction from the plugin context inside wordpress admin
Generate Ajaxized DIV for your function
Ajaxize will allow you to ajaxize almost any php function on your
site.
It can be a plugin, a function you wrote, or even a core wordpress
function.
There are some (obvious or less obvious) limitations currently:
Functions must return valid HTML - this will be called in php and returned via the
Ajax call
Functions cannot accept any parameters (at least at the moment)
Enter a function name below.
Function Name: xxx input field xxx what put in here? xxx
The generated div can be inserted to any page/post on the site and
will ajaxize the call to the function automatically.
Please make sure you enter a valid function name, that the function
does not require any parameters, and that it returns valid HTML.
In your context you want to refresh the calendar automaticaly when there is a change in the WP_Admin;
but you can't exactly do this.
You can write a Js method which will check the time of lastest modification of the calendar at the load of the page, stock it in Var.
After you'll have a constant (each 10seconds) Js "daemon" which will get the time of lastest modification of the calendar and compare it to the stocked Var; If change you reload the calendar.
PS: Ajaxify everything is not really a solution due of the developpement you need To Ajaxify and to code for people who has disabled Javascript.
Hope it helps

Resources