Asterisk - Transfer call record not saving in database and recording filename not overriding - asterisk

Before transferring call, Audio is recording correctly and overriding filename with custom filename format. Example FULLDATE_CUSTPHONE_INGROUP_TEST_AGENT
Here is the screenshot 1
But, When I transfer the call to InGroup. The file is recording, but not in exact format. And the record files are not saving in database.
Here is another screenshot for recording filename after Transferring Call to InGroup
My question is, how can I rename the filename with custom format?
Like FULLDATE_CUSTPHONE_INGROUP_TEST_AGENT

You can't rename file while it do writing.
You can stop recording, start with new filename.
Also you can add hangup header or read via AMI hangup event, after that move file as you wish.

Related

Can i get access over file in FileWriter Filter of Directshow

I have read the FileWriter Filter :
" The File Writer filter can be used to write files to disc regardless of format. The filter simply writes to disc whatever it receives on its input pin, so it must be connected upstream to a multiplexer that can format the file correctly. You can create a new output file with the File Writer or specify an existing file; if the file already exists, it will be completely overwritten with the new data. "
So my question is :
I am using the FileWriter filter for writing my audio stream into the disc. Before writing the file in the disc i want to access that file , so can it be possible or should i make my own custom filter.
File writer filter does not not provide you with options to change file sharing mode while the file is being written to. Additionally, in most cases your accessing the file before it is finalized makes no sense: the files are rarely written incrementally, file finalization changes data in the middle of the file and your accessing data before the file is closed might get you bad/incomplete stream.
Roman R is right. Writers are for writing. If you need transform data - write your own Transform filter.
You can ask me directly here.

Read from bytestream in asp

I'm wondering if it's possible to read from a bytestream without saving it.
I have a file, wich is a PDF that's in a mailbox. Through code I can access this mailbox and read out the attachements in it (the pdf's) At that point every pdf is in a bystream.
For now I just save it locally to test if my code works. But I need to work without saving the file.
Is there a way so I can get data from that file without saving. I need to process the first page and find the image in there (which is a qr code).
I have code to do this from a local file, but I want this to be directly from on of those in the bystreams.
Can I store the bytesteam in something like an object or a list of bytestreams and use that?

xml file back up?

I have a asp.net application which reads and updates and xml file in my file system.I do have the options edit and save.As of now it serves my purpose but what if the user edits the values and saves but for some reason he wants to restore the old values to the xml file.I want to
have an option called reset which will get the old values of the xml file incase the user wants to get back to the default values.How do i create a back up to the original file and how do i call that xml file ??? Can any one suggest whether i am in right path or not?
I am using Linq-to xml here .
Keep a copy of the original XML file. Call it xml_file.bk and when the user clicks "reset" delete the current XML file and make a copy of XML_File.bk to the real name with the .xml extension.
You can use File.Move(sourcefile, destinationFile) to make a copy of the original.
File.Move documentation.

Asp.net creating tab delimited txt file

I have to create a tab delimited txt file from a query.
I want to call an HttpHandler that returns my txt file as a stream, I don't want to create the file phisically.
1st question:
what is the best practice to create the tab delimited txt file from a query result?
I have to fetch all rows and create the file manually?
2nd question:
How to set a timeout for the HttpHandler that creates the file?
Thanks for your time.
I would create a plain old http output stream and change the content type to 'text/plain' which means that you don't need to physically create the file on the web server, and if you add the content-disposition header to the output and specify that it has an attachment called something like 'report.txt' the user will be prompted to Open or Save the content, rather than just viewing it in the browser like a normal web page.
You can use the Server.ScriptTimeout = x to set the script timeout by gaining access to the current HttpContext object
Hope this helps

Send file using Response.BinaryWrite() and delete it afterwards

As part of a Classic ASP Project the user should be able to download a file - which is dynamicly extracted from a zip archive and sent via Response.BinaryWrite() - by simply calling "document.asp?id=[some id here]".
Extracting and sending is not the problem but I need to delete the extracted file after the download finished. I never did any ASP or VBA before and I guess that's why I stuck here.
I tried deleting the file right after Response.WriteBinary() using FileSystemObject.DeleteFile() but this results in a 404-Error on the client-side.
How can I wait till the download finished and then do additional actions?
Edit: This is how my code looks like:
'Unzip a specified file from an archive and put it's path in *document*
set stream = Server.CreateObject("ADODB.Stream")
stream.Open
stream.Type = 1 ' binary
stream.LoadFromFile(document)
Response.BinaryWrite(stream.Read)
'Here I want to delete the *document*
I suspect that the point you are calling the DeleteFile method the file you are trying delete is currently locked by something else, the question is what?
Try including:-
stream.Close()
after your BinaryWrite. Also make sure you've done a similar thing to the component you've used to extract the file. If the component doesn't offer any obviouse "close" methods they trying assigning Nothing to the variables referencing them.
Is it not possible to stream the file into memory, then binary write the stream to the browser, this way the file is never created on the server and there is no need to delete it.
I found a solution: The extracted files are saved in a special directory and everytime a user runs the document.asp it checks this directory for files older than one hour and deletes them.
I think it's the simplest way to manage, but furthermore I would prefer a solution where the document is deleted after downloading.

Resources