[cisco-voip] UCCX Scripting and SQL 2005 ENCRYPTBYPASSPHRASE

Teixeira, Mike mwteixeira at bendbroadband.net
Thu Aug 5 15:03:29 EDT 2010


I have tested removing the variable and replacing it with the content, that test completed successfully.

I’ll try the document method, but, based on the test above it sounds like Cisco doesn’t support a variable inside a SQL function.

Is there a work around for this? Maybe a do step with a java script/program to insert the SQL statement? Another idea?

Thanks for the response.
Mike

From: avholloway at gmail.com [mailto:avholloway at gmail.com] On Behalf Of Anthony Holloway
Sent: Thursday, August 05, 2010 11:48 AM
To: Teixeira, Mike
Cc: cisco-voip at puck.nether.net
Subject: Re: [cisco-voip] UCCX Scripting and SQL 2005 ENCRYPTBYPASSPHRASE

I don't know the answer but:

It's possible that UCCX does not support variables inside of sql functions such as this.  One way to test that is to remove $sCCNumber, and replace it with a String literal such as "00000000000000" and see if that works.  If it does, then it's a problem with using variables inside of functions.  You did say you can insert $sCCNumber if you don't use the function correct?

It's also possible that UCCX expects a document when using this sql function.  So create a new Document variable and cast your sCCNumber like this as a test:

Set myDocumentVariable = (Document) sCCNumber

Anthony
On Wed, Aug 4, 2010 at 4:22 PM, Teixeira, Mike <mwteixeira at bendbroadband.net<mailto:mwteixeira at bendbroadband.net>> wrote:
Hello,

I am trying to use encryptbypassphrase an SQL 2005 SQL encryptiong with our UCCX 7.0 installation. The DB-Write is throwing an ArrayindexOutOfBounds Exception. I used to use a bitwise operation to store the data but this seems so much cleaner and secure.

When I view the db-fields using the DB-Write method the column in question(CCNumber) is showing up as a com.cisco.doc.Document. While the column is actually a varbinary(50). If I remove the encryptbypassphrase line from the SQL statement the data inserts without error. The variable that I am passing the encryptbypassphrase statement, is a string. I have tried a string, and a bigint. Do I need to create a document object variable for this to work? If so, how do I cast a string to the document variable? Can I even cast a string to a document variable?

Mike

Here is the SQL Statement.

INSERT INTO PayByPhone
(house, cust, CCNumber, CCExpMonth, CCExpYear, PaymentAmount, Processed, SubmittedOn)
VALUES ($LHouse, $iCust,
ENCRYPTBYPASSPHRASE('thisismypassphraseNotreallyIchangedit',$sCCnumber),
$LCCExpMonth, $LCCExpYear, $dblPaymentAmount, '0', GETDATE());

_______________________________________________
cisco-voip mailing list
cisco-voip at puck.nether.net<mailto:cisco-voip at puck.nether.net>
https://puck.nether.net/mailman/listinfo/cisco-voip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20100805/f2f98f83/attachment.html>


More information about the cisco-voip mailing list