UCCX how to write (append) data to txt or xml file

Unanswered Question
Sep 8th, 2010
User Badges:

Hi,


I would like to know how can i write data to one xml or txt file but not replacing the old data.Every time i write to file it should write in new line of same file not deleting previous lines.


Any suggestions?

Thanks


Best Regards

MC

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
Loading.
Aaron Harrison Thu, 09/09/2010 - 01:10
User Badges:
  • Super Bronze, 10000 points or more
  • Community Spotlight Award,

    Member's Choice, May 2015

Hi


One way is to do this (docVar being a document variable), the '\r' + '\n' + bit inserts a new line:


docVar = Create File Document ("test.txt")

docVar = docVar + '\r' + '\n' + "new line of text"

write document (docVar to "test.txt")


In general I do something like that if I'm maintaining a text log of something (e.g. a change log or something) which doesn't need to be replicated in the repository etc. You could probably do something similar with a repository document if you wanted but I'd be wary of the size it may reach or the amount of IO.


It's not normally useful for an XML document - the hierarchical nature of XML means that the last line is typically a closing tag to match the first line, so adding lines would invalidate it - you should generate the XML all at once, or carefully insert stuff in an appropriate place.


Regards


Aaron


Please rate helpful posts...

etmarcof Sun, 09/12/2010 - 12:47
User Badges:

Hi Aaron,


Thanks for your quick answer.


I want to write to a file abandoned calls (using contact inactive exception).


But couldn't i have concurrency issues writing to file if for example two users abandoned at same time? If yes , how can it be solved?


Best Regards

MC

Aaron Harrison Mon, 09/13/2010 - 01:50
User Badges:
  • Super Bronze, 10000 points or more
  • Community Spotlight Award,

    Member's Choice, May 2015

Hi


Why would you want to do that? UCCX automatically logs each call that comes into the system in the DB. An 'abandoned' call is generally one that is routed to a CSQ, but the customer hangs up. UCCX will automatically record this as an abandon, and you can report on this using the Historical Reports client.


No point reinventing the wheel, and yes, you would almost definately hit some concurrency issues which would result in your scripts terminating as they can't write to the txt file. You would also make it much more difficult to report on a potentially large bunch of flat text...


Aaron

vhawlaphant Mon, 09/13/2010 - 22:24
User Badges:

Hi Aaron,

I have an issue that user complaint that while they are in queue (about 20 minutes or so), the call just dropped. Would that consider an "abandonded" call? I could use the method to write information of the call to the text file for every time the call land to the queue. Do you have other means to trapp the "dropped" call like that?


Thanks,


Tom.

Aaron Harrison Tue, 09/14/2010 - 00:33
User Badges:
  • Super Bronze, 10000 points or more
  • Community Spotlight Award,

    Member's Choice, May 2015

Hi


If you have the CLI and approx time of the call, you can look in the MIVR logs (c:\program files\wfavvid\log\mivr) for that CLI number, and any major 'EXCEPTION' blocks that indicate a problem.


You can also check the CDR on CCM to see whether the far end or the UCCX system terminated the call (i.e. was the disconnect received from the PSTN first?).


Aaron

vhawlaphant Tue, 09/14/2010 - 08:28
User Badges:

Thanks Aaron,

The problem I have is do not know exactly when and which number is dropped from the queue. We found out only when user come to our office and complained. When I monitoring the queue and found nothing in the log indicate the dropped call. So if I can append to the text file the call when it in the queue, and append another line when the call get to agent. Doing that way, I hope to see 2 entry for each call. If only one from the queue, but not from agent accept call, then that may be a potential.

How do I ccheck CDR to see where it dropped the call? what specific word that I can filtering from the log?

Thanks.

vickskwt1 Wed, 06/18/2014 - 22:34
User Badges:

Hi Aaron,

docVar = Create File Document ("test.txt")

docVar = docVar + '\r' + '\n' + "new line of text"

write document (docVar to "test.txt")

 

I can program the 1st and 3rd lines, how do I write the 2nd line?? Keeping getting an error whent using "SET"

 

TIA

Victor

 

 

 

Actions

This Discussion