Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: masgar on June 09, 2017, 01:55:48 PM

Title: Calculate MD5 from IRD strategy
Post by: masgar on June 09, 2017, 01:55:48 PM
Hi, I'm a beginner with Genesys and I have to build a a strategy that call a http web service passing some parameters (collected digits). My problem is that the WS expects the MD5 of the collected digits and I don't know how to calculate MD5 of a string from an IRD strategy. I suppose I should use script in IRD and call it from strategy but I have no idea how to write the script to calculate md5.

Any help is much appreciated.

Thanks,
Max
Title: Re: Calculate MD5 from IRD strategy
Post by: terry on June 09, 2017, 09:02:37 PM
Assuming more or less up to date URS/IRD you can try md5 console command to URS: md5 some text.
Like RequestRouter['##SELF','urs/console?md5 abc','','',''] (RouterServer=##SELF, Method=urs/console, Params=md5 some text, all other parameters empty)

Back will be returned string in format md5("sometext")=..... so result had to be parsed to cut md5(...)= prefix.

[code]13:56:04.353_I_I_033902a3485fa00c [07:4e] HERE IS RDATA
    _R_I_ [07:4e] request 3 to server ##SELF sent: urs/console?md5 abc
13:56:04.367_I_I_033902a3485fa00c [09:04] <<<<<<<<<<<<suspend interp(RDATA), func:RequestRouter timers:00000
...
13:56:04.538_I_I_033902a3485fa00c [09:05] >>>>>>>>>>>>resume interp(0), func:RequestRouter
    _I_I_033902a3485fa00c [09:04] ASSIGN: out(LOCAL) <- STRING[1,44]: "md5("abc")=900150983cd24fb0d6963f7d28e17f72"


[/code]
Title: Re: Calculate MD5 from IRD strategy
Post by: cavagnaro on June 09, 2017, 10:37:06 PM
Where on earth is that documented or where you get this kind of info? O.o

Enviado de meu E6633 usando Tapatalk

Title: Re: Calculate MD5 from IRD strategy
Post by: terry on June 10, 2017, 01:59:00 AM
Function RequestRouter send "web request" (= invoke URS WEB API)  to some other router or to itself.
More or less WEB API description can be taken from running URS instance itself (if enable http port and ask with web browser urs/help).
Title: Re: Calculate MD5 from IRD strategy
Post by: cavagnaro on June 10, 2017, 02:03:54 AM
And that md5? Is that described on that API help?
Title: Re: Calculate MD5 from IRD strategy
Post by: terry on June 10, 2017, 05:34:16 AM
Only that console command named md5 exists (without any details).
Title: Re: Calculate MD5 from IRD strategy
Post by: masgar on June 12, 2017, 02:35:09 PM
Thanks for suggestion. I had temporarily solved using a stupid php web page that returns the MD5 of any string I pass to it.

Max