Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
bernd_honsa
Explorer


I've summarized my experience for the task "Scripting of CRM processes incl. CTI connection (telephony) with HP LoadRunner" in a document.

The main target was to make the script stable and repeatedly executable as well as usable for parallel users.

 

I used HP LoadRunner 11.52 and the test system based on CRM 7.0 incl. a CTI system by Unify.

A special hard- and software for the simulation of inbound calls was also included.

For the simulation of outbound calls we had a lot of real phones in place.



 

 

Introduction


 

 

When scripting of CRM processes in the Contact Information Center (CICO) as for order or computer telephony integration (CTI), I came again and again to issues by multiple executions of the virtual user script. Even if the script with appropriate correlation rules is initially repeatedly executable then it did not work after some time/iterations. In addition my previous correlation rules did not work any longer when I’m scripting inbound / outbound processes (CIC agent is called or calls from CRM a phone number).

After lengthy analysis and programming work I have come with the support of SAP colleagues Dr. Alexander Pilz, Matthias Rode and Henning Dürholt to a solution. Within this solution. Due to this solution I also find out the reason of the errors why I had constantly rescript normal CIC processes such as "Create Order" or "Process Alerts".

For a better understanding you have to know that there are several communication channels and technologies. The regular, CRM UI oriented, processes run via the BSP. The communication with CTI however uses JSPs with javascript elements.

The following figure shows the basic communication between the Interaction Center (IC) Web Client (which is to be simulated by the LoadRunner) and CRM as well CTI.



This means that you need for all activities in the area of "Create Order", "Alerting" different web calls on ".../bc/bsp/sap/crm_ui_frame/BSPWDApplication.do ...".

For any action in telephony sector like "Call", "Set ready", "Hang up" etc. you have to script a call to ".../bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm ...". In addition, the real client send every 30 seconds a ping at this URL. This is important when you plan to script a hold for the telephone communication. In this case, every 30 sec such a ping have to be discontinued. You also deal with the problem for waiting period through lr_think_time() > http-request-timeout.

Now we come to the procedure of the initialization and the main correlations rules. The process is demonstrating like this:

 

  1. Call the application URL

  2. Login at CRM with user/password

  3. Possibly closing of open user sessions

  4. Connection to CRM-UI session manager

  5. Call of IC-footer

  6. Possibly closing of IC communication channels (telephony)

  7. Initialization of the IC-header

  8. Determining of the unique time strings for the CRM-IC-communication

  9. Twice call of the main page (main.htm)

  10. Determining of the clear Phone-UID


 

Description


For the description of the various correlation rules I will demonstrate this based on individual code fragments.

Call the application URL


A typical call looks like this:

web_url("default.htm",

"URL=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm",


"Resource=0",


"RecContentType=text/html",


"Referer=",


"Snapshot=t308.inf",


"Mode=HTML",


EXTRARES, "Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/loading/loading_ani.gif?7.33.3.3.0",ENDITEM,


"Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/button/6x1_btn_emphLS.gif?7.33.3.3.0",ENDITEM,


"Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/combobox/ico12_combo.gif?7.33.3.3.0",ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/MessageBundle.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/Form.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/PopupManager.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/InputField.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/EditFieldBase.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/GridLayout.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/ScrollContainer.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/Button.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/SingleColumnLayout.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/Container.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/AccessibilityHelper.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/Label.js?6E00A4C056FA", ENDITEM, "Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/button/btn_emph_dbLS.gif?7.33.3.3.0",ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/Link.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/ComboBox.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/DataTip.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/LayeredControl.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/1x1.gif", ENDITEM,


"Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/statusicons/dtp/ico12_dtp_error.gif?7.33. 3.3.0", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/DragAndDropManager.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/SuggestBoxListBox.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/ComboBoxListBox.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/ItemListBox.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/ItemListBoxItem.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/DragSession.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw5/themes/sap_chrome/common/button/6x1_btn_emph_hoverLS.gif?7.33.3.3.0", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/LoadingAnimation.js?6E00A4C056FA", ENDITEM,


"Url=/sap/public/bc/ur/nw7/js/classes/BlockLayer.js?6E00A4C056FA", ENDITEM,


LAST);


 

web_url("messagebundle_de.properties",

"URL=https://{appserver}/sap/public/bc/ur/nw7/js/texts/messagebundle_de.properties?6E00A4C056F A",


"Resource=0",


"RecContentType=text/html",


"Referer=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm",


"Snapshot=t309.inf",


"Mode=HTML",


LAST);


 

There are no necessary correlation rules.

 

Login at CRM with user/password


For this section the first correlation rules have to be defined.

// SAPBCTWO11 looks similar like this“ bD1lbiZjPTEwMCZkPW1pbg==”. It could happen that it still exists open CRM sessions for the user. In this case SAPBCTWO11 will be empty after the web call. But for this situation a warning will be output (Notfound=Warning).

 

web_reg_save_param("SAPBCTWO11",

"LB/IC=sap(",


"RB/IC=)/bc/bsp/sap/crm_ui_frame",


"Ord=1",


"Search=Body",


"Notfound=warning",


LAST);


 

// SAP_CONTEXTID sometimes is written as HTML (“SID:ANON:{appserver}”) and sometimes as URL („SID%3aANON%3a{appserver}“) in the web call response. It looks similar like this "8FkjqPEyfzOZIDGoR2Anw-QxmALsZdcjtcGlwQ3i". Therefore I try to save both variants and save the non-empty variant in SAP_CONTEXTID.

 

web_reg_save_param("SAP_CONTEXTID_NEW",

"LB=sap-contextid=SID%3aANON%3acrmserver100_CRM_01%3a",


"RB=NEW",


"Ord=1",


"Search=All",


"Notfound=Warning",


LAST);


 

web_reg_save_param("SAP_CONTEXTID_ATT",

"LB=sap-contextid=SID:ANON:crmserver100_CRM_01:",


"RB=ATT",


"Ord=1",


"Search=All",


"Notfound=Warning",


LAST);


 

// SAP_APPCONTEXT looks similar like this "c2FwLXNlc3Npb25pZD1TSUQlM2FBTk9OJTNhcmV5aXgxMDBfUkVZXzAxJTNhOEZrakJmWWo2M0NEWnNJUkUxWU9JdXJvQ0FMc1pZOGtKTUg4R2RiNy1BVFQ%3d”. It can happen that it still exists open CRM sessions for the user. In this case SAP_APPCONTEXT will be empty but a warning will be output (Notfound=Warning).

 

web_reg_save_param("SAP_APPCONTEXT", "LB=sap-appcontext=",

"RB=;",


"Ord=1",


"Search=Headers",


"Notfound=Warning",


LAST);


 

web_submit_data("default.htm_2",

"Action=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm", "Method=POST",


"RecContentType=text/html", "Referer=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm", "Snapshot=t310.inf",


"Mode=HTML",


ITEMDATA,


"Name=FOCUS_ID", "Value=sap-user", ENDITEM,


"Name=sap-system-login-oninputprocessing", "Value=onLogin", ENDITEM,


"Name=sap-urlscheme", "Value=", ENDITEM,


"Name=sap-system-login", "Value=onLogin", ENDITEM,


"Name=sap-system-login-basic_auth", "Value=", ENDITEM,


"Name=sap-accessibility", "Value=", ENDITEM,


"Name=sap-system-login-cookie_disabled", "Value=", ENDITEM,


"Name=sysid", "Value=CRM", ENDITEM,


"Name=sap-client", "Value=100", ENDITEM,


"Name=sap-user", "Value={userid}", ENDITEM,


"Name=sap-password", "Value={password}", ENDITEM,


"Name=sap-language", "Value=EN", ENDITEM,


"Name=sap-language-dropdown", "Value=Englisch", ENDITEM, "Name=SAPEVENTQUEUE", "Value=ComboBox_Select~E002Id~E004sap-language-


dropdown~E005Key~E004EN~E005ByEnter~E004true~E003~E002ResponseData~E004delta~E003~E002~E003~ E001Form_Submit~E002Id~E004SL__FORM~E003~E002ClientAction~E004submit~E005ActionUrl~E004~E005Re sponseData~E004full~E005PrepareScript~E004~E003~E002~E003", ENDITEM,


EXTRARES,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/background-button-hover.gif", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtransborders-left.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtransborders-right.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/logo_sap_crm.gif", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtranstl.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtransbl.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtrans.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


LAST);


 

Possibly closing of open user sessions


Sometimes it happens that it still exists open CRM sessions for the user. These have to be closed.

 

// If SAPBCTWO11 is empty then it still exists open CRM sessions for the user.

if (strcmp(lr_eval_string("{SAPBCTWO11}"),"") == 0) {

i = 1; }


if (i==1){

// Resave of SAPBCTWO11


web_reg_save_param("SAPBCTWO11",


"LB/IC=sap(",


"RB/IC=)/bc/bsp/sap/crm_ui_frame",


"Ord=1",


"Search=Body",


"Notfound=warning",


LAST);


 

// The same for SAP_APPCONTEXT


if (strcmp(lr_eval_string("{SAP_APPCONTEXT}"),"") == 0) {


web_reg_save_param("SAP_APPCONTEXT",


"LB=sap-appcontext=",


"RB=;",


"Ord=1",


"Search=Headers",


LAST);


}


 

if (strcmp(lr_eval_string("{SAP_CONTEXTID_NEW}"),"") == 0) {


web_reg_save_param("SAP_CONTEXTID_NEW",


"LB=sap-contextid=SID%3aANON%3acrmserver100_CRM_01%3a",


"RB=NEW",


"Ord=1",


"Search=All",


"Notfound=Warning",


LAST);


}


 

// {SessionToken} = "D6NTXPSgeKSWdpIFtF7fuw" web_reg_save_param("SessionToken",


"LB/IC=session_token=",


"RB/IC==",


"Ord=1",


"Search=Body",


LAST);


 

// Closing of open CRM sessions


web_submit_data("default.htm_close",


"Action=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm",


"Method=POST",


"RecContentType=text/html", "Referer=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-system-login=X&sap-system-login-cookie=X&sap-contextid=SID:ANON:crmserver100_CRM_01:{SAP_CONTEXTID}ATT", "Snapshot=t20.inf",


"Mode=HTML",


ITEMDATA,


"Name=FOCUS_ID", "Value=SESSION_QUERY_CONTINUE_BUTTON", ENDITEM, "Name=sap-system-login-oninputprocessing", "Value=on


SessionQuery", ENDITEM, "Name=sap-urlscheme", "Value=", ENDITEM,


"Name=sap-system-login", "Value=onSessionQuery", ENDITEM, "Name=sap-system-login-basic_auth", "Value=", ENDITEM,


"Name=sap-client", "Value=100", ENDITEM,


"Name=sap-language", "Value=EN", ENDITEM,


"Name=sap-accessibility", "Value=", ENDITEM,


"Name=delete-session-cb", "Value=X", ENDITEM,


"Name=delete_session", "Value=X", ENDITEM,


"Name=SAPEVENTQUEUE",


"Value=Form_Submit~E002Id~E004SL__FORM~E003~E002ClientAction~E004submit~E005ActionUrl~E004~E005 ResponseData~E004full~E005PrepareScript~E004~E003~E002~E003", ENDITEM,


EXTRARES,


"Url=/sap/public/bc/ur/nw7/js/classes/BlockLayer.js?6E00A4C056FA", "Referer=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-system-login=X&sap-system-login- cookie=X&sap-contextid=SID:ANON:crmserver100_CRM_01:{SAP_CONTEXTID}ATT", ENDITEM, "Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/background-button-hover.gif", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM, "Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtransborders-right.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM, "Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtransborders-left.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM, "Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/logo_sap_crm.gif", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM, "Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtransbl.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtranstl.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/default/styling/uifboxtrans.png", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


"Url=/sap/public/bsp/sap/public/bc/htmlb/1x1.gif", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm", ENDITEM,


LAST);


lr_output_message("THERE WERE PENDING SESSIONS");


i=0; }


else {

lr_output_message("THERE WERE <<NO>> PENDING SESSIONS");


}

 

Connection to CRM-UI session manager


Below a connection is opened to CRM-UI session manager.

 

// SAPSessionManager41 looks similar like this "ZT1SRVZRUXpBeE0xOWZYMTlmTWpJd05GOWZVclQ2TkQtV0dkRGhBSUFBQ21JUWd3PT0". This ID is required for the login.

 

web_reg_save_param("SAPSessionManager41",

"LB/IC=(",


"RB/IC==)",


"Ord=1",


"Search=Body",


"RelFrameId=1",


LAST);


 

web_submit_data("uif_callback",

"Action=https://{appserver}/sap/webcuif/uif_callback?sap-client=100&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER", "Method=POST",


"RecContentType=text/plain", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm",


"Snapshot=t311.inf",


"Mode=HTML",


ITEMDATA,


"Name=cmd", "Value=get_esid", ENDITEM,


LAST);


 

web_custom_request("uif_callback_2",

"URL=https://{appserver}/sap/webcuif/uif_callback?sap-client=100&sap-language=EN&sap-


domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER", "Method=POST",


"Resource=0", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm",


"Mode=HTML",


"Body=cmd=store_request&esid=({SAPSessionManager41}=)&",


LAST);


 

Call of IC-footer


Now there follows a series of requests that taken together give the UI in the browser. It starts with the IC-footer that consist e.g. a continuous status message. Here, the connection is opened for CTI and determined the IC session ID.

 

// The ICSessionID looks something like this "20131220130112.1503480". It can happen that it still exists open communication channels (e.g. for telephony). In this case the ICSessionID is empty but it is only issued a warning message (Notfound=Warning).

 

web_reg_save_param("ICSessionID",

"LB/IC=crm-icsessionsyncid=",


"RB/IC= &crm",


"Ord=1",


"Search=Body",


"RelFrameId=1",


"Notfound=Warning",


LAST);


 

// The SAPLocation1 looks something like this "bD1FTiZjPTEwMCZpPTEmZT1SRVZRUXpBeE0xOWZYMTlmTWpJd05GOWZVclQ2TkQtV0dkRGhBSUFBQ21JUWd 3JTNkJTNk". It is very important for the rest because the most following URL-calls will need this ID.

 

web_reg_save_param("SAPLocation1",

"LB=location: /sap(",


"RB=)",


"Search=All",


"Notfound=Warning",


LAST);


 

web_url("main.htm",

"URL=https://{appserver}/sap({SAPSessionManager41}=)/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=100&sap-language=EN&sap-domainRelax=min&saprole=Y2ICAGENT",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm",


"Snapshot=t312.inf",


"Mode=HTML",


LAST);


 



Possibly closing of IC communication channels (telephony)


If it still exists open communication channels then it have to be closed. Otherwise no calls can be accepted. This can be easily checked whether the  ICSessionID is empty or not.

 

// Initialization of the variable because it has already been used previously.

i=0;

 

if (strcmp(lr_eval_string("{ICSessionID}"),"") == 0) {

i = 1;


}

 

if (i==1){

web_reg_save_param("ICSessionID",


"LB/IC=crm-icsessionsyncid=",


"RB/IC= &crm",


"Ord=1",


"Search=Body",


"Notfound=Warning",


LAST);


 

/*Select open channel for this session*/

web_submit_data("sessionManager.htm",

"Action=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/iccmp_ccs/sessionManager.htm?sap-client=100&sap-domainrelax=min&sap-language=EN&&",


"Method=POST",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/iccmp_ccs/sessionManager.ht m?sap-client=100&sap-domainrelax=min&sap- language=EN&SESSION_TOKEN={SessionToken}==&session_token={SessionToken}%3d%3d",


"Snapshot=t23.inf",


"Mode=HTML",


ITEMDATA,


"Name=htmlbevt_ty", "Value=htmlb:button:click:0", ENDITEM,


"Name=htmlbevt_frm", "Value=myFormId", ENDITEM,


"Name=htmlbevt_oid", "Value=thtmlb_button_6", ENDITEM,


"Name=htmlbevt_id", "Value=continue", ENDITEM,


"Name=htmlbevt_cnt", "Value=0", ENDITEM,


"Name=onInputProcessing", "Value=htmlb", ENDITEM,


"Name=sap-htmlb-design", "Value=", ENDITEM,


"Name=rbg_options", "Value=1", ENDITEM,


"Name=SESSION_TOKEN", "Value={SessionToken}==", ENDITEM,


EXTRARES, "Url=/sap/bc/bsp/sap/crmcmp_ic_frame/stylesheets/broadcast/NOVA/_images/IC/queueBac kground.gif", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/broadcast_ bar.htm", ENDITEM, "Url=/sap/bc/bsp/sap/crmcmp_ic_frame/stylesheets/broadcast/NOVA/_images/IC/statusAre aBackground.gif", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/broadcast_ bar.htm", ENDITEM,


LAST);


lr_output_message("THERE WAS OPEN CHANNEL");


i=0; }


else {

lr_output_message("THERE WAS <<NO>> OPEN CHANNEL");


}

 

Initialization of the IC-header


Now the header of the Interaction Centers will be built up. That also needs to determine the AccessToken.

 

// The AccessToken looks something like this "c3N0PUU3RUQyQjc5QzAwNzg5QkU3MzIzRUZENDJFNTAzRjYwNTJCNEZBQTAzRjk4MjZBMEUxMDA4MDAwMEE2MjEwODM". It will need for the communication with the CTI-system.

 

web_reg_save_param("AccessToken",

"LB/IC=access_token=",


"RB/IC==",


"Ord=1",


"Search=Body",


"RelFrameId=1",


LAST);


 

web_url("mcmain_header.htm",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain.htm?sap-client=100&sap-domainrelax=min&sap-language=EN",


"Snapshot=t315.inf",


"Mode=HTML",


LAST);


 

web_url("mcmain_tabs.htm",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_tabs.htm",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain.htm?sap-client=100&sap-domainrelax=min&sap-language=EN",


"Snapshot=t313.inf",


"Mode=HTML",


LAST);


 

web_url("broadcast_bar.htm",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/broadcast_bar.htm",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain.htm?sap-client=100&sap-domainrelax=min&sap-language=EN",


"Snapshot=t314.inf",


"Mode=HTML",


LAST);


 

web_url("ic_base_broadcast_sort_and_filter.xsl",

"URL=https://{appserver}/sap/bc/bsp/sap/crmcmp_ic_frame/scripts/broadcast/ic_base_broadcast_sort_and_filter.xsl",


"Resource=0",


"RecContentType=text/xml", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/",


"Snapshot=t316.inf",


"Mode=HTML",


LAST);


 

web_url("ic_base_broadcast_xml_to_html.xsl",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/ic_base_broadcast_xml_to_html.xsl",


"Resource=0",


"RecContentType=text/xml", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/",


"Snapshot=t317.inf",


"Mode=HTML",


LAST);


 

Determining of the unique time strings for the CRM-IC-communication


In the further course it will need a unique Client-ID for some web calls that is nothing else as a time stamp for a particular time. Therefore I named it TIMESTRING_CALL. It will need mainly for the CTI-communication. With regular pings on the IC channel it is enough to determine the time stamp at the web call time. In addition it will need a date string for the IC-calls. I always calculate these directly before the web call and save it in the variable DATUMSTRING. From this time I try to determine repeatedly the call-handler as well as the agent phone number. The values are saved in PhoneUID and InboundNo.

 

char* function_datestring() {

char daystring[1024]; char* return_value;


// Example Fri%2C%2020%20Dec%202013%2013%3A01%3A35%20 lr_save_datetime("%a", DATE_NOW, "cwday");


lr_save_datetime("%d", DATE_NOW, "cday");


lr_save_datetime("%b", DATE_NOW, "cmonth");


lr_save_datetime("%Y", DATE_NOW, "cyear");


lr_save_datetime("%H", DATE_NOW, "chour");


lr_save_datetime("%M", DATE_NOW, "cmin");


lr_save_datetime("%S", DATE_NOW, "csec");


strcpy(daystring, lr_eval_string("{cwday}"));


strcat(daystring,"%2C%20");


strcat(daystring, lr_eval_string("{cday}"));


strcat(daystring, "%20");


strcat(daystring, lr_eval_string("{cmonth}"));


strcat(daystring, "%20");


strcat(daystring, lr_eval_string("{cyear}"));


strcat(daystring, "%20");


strcat(daystring, lr_eval_string("{chour}"));


strcat(daystring, "%3A");


strcat(daystring, lr_eval_string("{cmin}"));


strcat(daystring, "%3A");


strcat(daystring, lr_eval_string("{csec}"));


strcat(daystring, "%20");


 

return_value = lr_eval_string(daystring);


 

return return_value;


}

 

char* function_timestring() {

typedef long time_t;


time_t t;


char timestring[32];


char* return_value;


itoa(time(&t),timestring,10);


return_value = lr_eval_string(timestring);


return return_value;


}

 

// date string definition lr_param_sprintf("DATESTRING","%s",function_datestring());

 

// The InboundNo is the phone number of the agent and looks something like this „491235543“

 

web_reg_save_param("InboundNo",

"LB=(\'From\'),_u(\'%2b",


"RB=\'",


"Ord=1", "NotFound=WARNING", "Search=Body",


LAST);


 

// The PhoneUID looks something like this “7f7726dff9604bebbaf2b22e06af5106”. It will need at various moments of the CTI communication and have to request constantly until the script gets a relevant value as the response. This response/value corresponds to the call-handler of the CTI system. Without this value no action will work with the CTI system.

 

web_reg_save_param("PhoneUID", "LB=(\'ContactStarted\')],[_u(\'media\'),_u(\'phone\')],[_u(\'id\'),_u(\'",


"RB=\'",


"Ord=1",


"NotFound=WARNING",


"Search=All",


LAST);


 

web_reg_save_param("LogStatus",

"LB=(\'user_state_text\'),_u(\'",


"RB=\'",


"Ord=1",


"NotFound=WARNING",


"Search=All",


LAST);


 

// This is a typical poll-call to the CTI system. This will executed normally every 30 sec by the client-side application in the browser like a ping. As a new parameter appserver_2 appears. That's basically the same value like appserver but in the URL format.

 

web_custom_request("sam_js2bsp_sender.htm",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm?


sap-session_access_token={AccessToken}=",


"Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t319.inf",


"Mode=HTML", "Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=null&n0=_sam_js_poll&v0=true&n1=_sam_js_cl ient_queue_receiver_name&v1=CL_SAM_CLIENT_QUEUE_RECEIVER&n2=_sam_bsp_session_queue&v2=https% 3A%2F%2F{appserver_2}%2Fsap"


"({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap -session_access_token%3D{AccessToken}%3D&n3=_sam_message_sent_time&v3={DATESTRING}UTC",


LAST);


 

// timestring lr_param_sprintf("TIMESTRING_CALL","%s",function_timestring());

 

web_url("default.htm_3",

"URL=https://{appserver}/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-accessibility=&sap-rtl=&crm-icsessionsyncid={ICSessionID}%20&crm-iccc=X&crm-icwscl=100&sap-domainrelax=min&sap- language=EN&sapoutype=S&sapouid=50000166&sap-client=100&saprole=Y2ICAGENT&crm- icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain.htm?sap-client=100&sap-domainrelax=min&sap-language=EN",


"Snapshot=t320.inf",


"Mode=HTML",


LAST);


 

Twice call of the main page (main.htm)


Now once more it will built connections to the CRM-UI session manager (uif_callback) and to the main page (main.htm). For that it are determined and saved the parameter SAPBCTWO75 and WCFSECUREID76 in the further course. Furthermore it is used the unique TIMESTRING_CALL in the web calls.

 

// The SAPSessionManager61-ID looks something like this "ZT1SRVZRUXpBeE0xOWZYMTlmTWpJd05GOWZVclQ4WHo5a0RURGhBSUFBQ21JUWd3PT0". It is only used certainly the next two requests (uif_callback_4, main.htm_2).

 

web_reg_save_param("SAPSessionManager61",

"LB/IC=(",


"RB/IC==)",


"Ord=1",


"Search=Body",


"RelFrameId=1",


LAST);


 

lr_think_time(2);

 

web_submit_data("uif_callback_3",

"Action=https://{appserver}/sap/webcuif/uif_callback?sap-client=100&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER", "Method=POST",


"RecContentType=text/plain",


"Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm?crm- icsessionsyncid={ICSessionID}%20&crm-iccc=X&crm- icwscl=100&sapoutype=S&sapouid=50000166&saprole=Y2ICAGENT&crm- icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}",


"Snapshot=t322.inf",


"Mode=HTML",


ITEMDATA,


"Name=cmd",


"Value=get_esid",


ENDITEM,


LAST);


 

web_custom_request("uif_callback_4",

"URL=https://{appserver}/sap/webcuif/uif_callback?sap-client=100&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER", "Method=POST",


"Resource=0",


"Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm?crm- icsessionsyncid={ICSessionID}%20&crm-iccc=X&crm- icwscl=100&sapoutype=S&sapouid=50000166&saprole=Y2ICAGENT&crm- icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}",


"Mode=HTML",


"Body=cmd=store_request&esid=({SAPSessionManager61}=)&crm- icsessionsyncid={ICSessionID}%20&crm-iccc=X&crm- icwscl=100&sapoutype=S&sapouid=50000166&saprole=Y2ICAGENT&crm- icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}",


LAST);


 

// The SAPBCTWO75-ID looks something like this "bD1FTiZjPTEwMCZpPTEmZT1SRVZRUXpBeE0xOWZYMTlmTWpJd05GOWZVclQ4WHo5a0RURGhBSUFBQ21JUW d3JTNkJTNk". It will use mostly in the next calls and served to authorization. If it will not set correctly then it conducts to http 403 errors.

 

web_reg_save_param("SAPBCTWO75",

"LB/IC=sap(",


"RB/IC=)/bc/bsp/sap/crm_ui_frame",


"Ord=1",


"Search=All",


LAST);


 

web_url("main.htm_2",

"URL=https://{appserver}/sap({SAPSessionManager61}=)/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=100&sap-language=EN&sap-domainRelax=min&saprole=Y2ICAGENT",


"Resource=0",


"RecContentType=text/html",


"Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm?crm- icsessionsyncid={ICSessionID}%20&crm-iccc=X&crm- icwscl=100&sapoutype=S&sapouid=50000166&saprole=Y2ICAGENT&crm- icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}",


"Snapshot=t324.inf",


"Mode=HTML",


LAST);


 

// The WCFSECUREID76-ID looks something like this "3D6E15885ECCA939A465F445A506A081". It will use mostly in the next calls and served to authorization. If it will not set correctly then it conducts to http 403 errors.

 

web_reg_save_param("WCFSECUREID76",

"LB/IC=name=\"wcf-secure-id\" value=\"",


"RB/IC=\" />",


"Ord=1",


"Search=Body",


"RelFrameId=1.2", LAST);


 

web_url("main.htm_3",

"URL=https://{appserver}/sap({SAPBCTWO75})/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=100&sap-domainrelax=min&sap-language=EN", "Resource=0",


"RecContentType=text/html",


"Referer=https://{appserver}/sap({SAPBCTWO75})/bc/bsp/sap/crmcmp_ic_frame/main.htm?crm- iccc=X&crm-icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}&crm-icsessionsyncid={ICSessionID}%20&crm- icwscl=100&sap-client=100&sap-domainrelax=min&sap-language=EN",


"Snapshot=t326.inf",


"Mode=HTML",


LAST);


 

Determining of the clear Phone-UID


As mentioned you will need a call handler for all telephony requests to CTI. This will save in parameter PhoneUID. When this parameter was not determined yet in last preceding ping-/poll-requests like „sam_js2bsp_sender.htm“ then it have to implement a loop for that. This will run through as often as the call handler was identified. I’ve implemented two functions for that. It will execute before and after each ping-/poll-request.

 

void function_precheck_inbound() {

if (strcmp(lr_eval_string("{InboundNo}"),"") == 0) {


// Inbound call number


web_reg_save_param("InboundNo",


"LB=(\'From\'),_u(\'%2b",


"RB=\'",


"Ord=1",


"NotFound=WARNING",


"Search=Body",


LAST); }


else {


// Maybe new Inbound call number


web_reg_save_param("InboundNo_2",


"LB=(\'From\'),_u(\'%2b",


"RB=\'",


"Ord=1",


"NotFound=WARNING",


"Search=Body",


LAST);


}


 

if (strcmp(lr_eval_string("{PhoneUID}"),"") == 0) {


web_reg_save_param("PhoneUID",


"LB=(\'ContactStarted\')],[_u(\'media\'),_u(\'phone\')],[_u(\'id\'),_u(\'", "RB=\'",


"Ord=1",


"NotFound=WARNING",


"Search=All",


LAST);


}


 

web_reg_save_param("StatusConnection",


"LB=(\'event_name\'),_u(\'",


"RB=\'",


"Ord=1",


"NotFound=WARNING",


"Search=All",


LAST);


}

 

// date string definition

lr_param_sprintf( "DATESTRING","%s",function_datestring() );

 

do{

function_precheck_inbound( );


 

// ping-Request


web_custom_request("sam_js2bsp_sender.htm_14",


"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm?sap-session_access_token={AccessToken}=",


"Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t415.inf",


"Mode=HTML",


"Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_s ess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=browser_ping&n0=p1&v0={TIMESTRING}&n1=ic wc_eventname&v1=icwc.mcm.browser.ping&n2=icwc_sam_message_listener&v2=icwc_mcm_client_event_list ener&n3=_sam_bsp_session_queue&v3=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp %2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&n4=_sam_message_sent_time&v4={DATESTRING}UTC",


LAST);


 

function_postcheck_inbound( );


 

function_precheck_inbound( );


 

// poll-Request


web_custom_request("sam_js2bsp_sender.htm_14b",


"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm?sap-session_access_token={AccessToken}=", "Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t456.inf",


"Mode=HTML",


"Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_s ess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=null&n0=_sam_js_poll&v0=true&n1=_sam_js_cl ient_queue_receiver_name&v1=CL_SAM_CLIENT_QUEUE_RECEIVER&n2=_sam_bsp_session_queue&v2=https% 3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_q ueue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&n3=_sam_message_sent_time&v3={DATESTRING}UTC",


EXTRARES,


"URL=/sap/bc/bsp/sap/crmcmp_ic_frame/stylesheets/contextarea/NOVA/_images/IC/buttonB_highlight.GIF",


"Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crmcmp_hdr/bspwdapplication.do?saprole=Y2IC AGENT", ENDITEM,


LAST);


 

function_postcheck_inbound( );


 

function_checkLogStatus( );


 

} while (strcmp(lr_eval_string("{InboundNo}"),"") == 0);

 

Typical requests to telephony


The previous advices, hints and script examples are helpful especially for the initialization of the user. If your scenario includes additional activities for the telephony at CTI system then you can use the following script examples.

Receipt/accept an inbound call (telephone call by an agent from outside)


By these requests you can accept a telephone call by an agent. It’s visible in the request that the call handler have to be forwarded to the CRM.

 

web_custom_request("BSPWDApplication.do_2",

"URL=https://{appserver}/sap({SAPBCTWO75})/bc/bsp/sap/crm_ui_frame/BSPWDApplication.do?sap-client=100&sap-domainrelax=min&sap-language=EN",


"Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPBCTWO75})/bc/bsp/sap/crm_ui_frame/BSPWDApplication.do?sap-client=100&sap-domainrelax=min&sap-language=EN",


"Snapshot=t458.inf",


"Mode=HTML",


"Body=htmlbevt_ty=htmlb%3Abutton%3Aclick%3A0&htmlbevt_frm=myFormId&htmlbevt_oid=C7_W2 7_V28_CONTEXTAREA_ALERTDISPLAY_FORWARDCALL&htmlbevt_id=forwardCall&htmlbevt_cnt=0&onInputPro cessing=htmlb&SVH_INPUTFIELD_ID=&SVH_INPUTFIELD_VALUE=&thtmlbModifiedInputfieldIds=&sap-htmlb- design=&sap-ajaxtarget=C1_W1_V2_C7_W27_V28_hiddenview.do&sap-ajax_dh_mode=AUTO&wcf-secure- id={WCFSECUREID76}&thtmlbKeyboardFocusId=C2_W12_V13_V14_tv1- persbutton&thtmlbKeyboardSelectId=&thtmlbSliderState=&th-navbar- state=&PREFIX_ID=C7_W27_V28_&C7_W27_V28_SCRATCHPAD_TEXT=&C7_W27_V28_CONTEXTAREA_ALERTD ISPLAY_PREVIOUS_ALERTS=&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_PREVIOUS_HASMORE=&C7_W27_V 28_CONTEXTAREA_DNISDISPLAY_PREVIOUS_INFO=&C7_W27_V28_CONTEXTAREA_TOPIC_ID=&C7_W27_V28_ CONTEXTAREA_ALERTDISPLAY_SELECTED_MESSAGE=&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED _HASLINK=&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED_CODE=IC.NewRequest&C7_W27_V28_CO NTEXTAREA_ALERTDISPLAY_SELECTED_VALUE1=ContactStarted&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY _SELECTED_VALUE2=p"


"hone&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED_VALUE3={PhoneUID}&C7_W27_V28_ CONTEXTAREA_ALERTDISPLAY_SELECTED_VALUE4=%252B{phone}&C7_W27_V28_CONTEXTAREA_ALERTDISPL AY_SELECTED_VALUE5=%252B{InboundNo}&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED_VALUE6= Inbound&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED_VALUE7=3&C7_W27_V28_CONTEXTAREA_A LERTDISPLAY_SELECTED_VALUE8=&C7_W27_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED_VALUE9=&C7_W2 7_V28_CONTEXTAREA_ALERTDISPLAY_SELECTED_VALUE10=&C7_W27_V28_SCRATCHPAD_DUMMY_FIELD=&C 7_W27_V28_ACTION_GUID=&C7_W27_V28_AC_OBJECT_KEY=&C7_W27_V28_AC_VALUE=&C7_W27_V28_AC_ CONTAINER=&C7_W27_V28_MYITSLOCATION=&crmFrwScrollXPos=0&crmFrwScrollYPos=0&crmFrwOldScrollXP os=0&crmFrwOldScrollYPos=0&flashIslandsAsString=&callbackFlashIslands=%2Fsap({SAPBCTWO75})%2Fwebcui f%2Fuif_callback%3Fcrm_handler%3DCL_THTMLBX_FLASH_ISLAND&silverlightIslandsAsString=&callbackSilverli ghtIslands=%2Fsap({SAPBCTWO75})%2Fwebcuif%2Fuif_callback%3Fcrm_handler%3DCL_THTMLBX_SILVERLIGH T_ISLAND&th-mes-isex=&C1_W1_V2_V3_V37_bc"


"history_selection=&C2_W12_V13_V14_tv1_editMode=SINGLE&C2_W12_V13_V14_tv1_isCellerator=T RUE&C2_W12_V13_V14_tv1_selectedRows=&C2_W12_V13_V14_tv1_rowCount=0&C2_W12_V13_V14_tv1_la stSelectedRow=&C2_W12_V13_V14_tv1_visibleFirstRow=1&C2_W12_V13_V14_tv1_scrollPosition=&C2_W12_ V13_V14_tv1_hscrollPosition=0&C2_W12_V13_V14_tv1_bindingString=%2F%2FCallLists%2FTable&C2_W12_V 13_V14_tv1_fixedColumns=&C2_W12_V13_V14_tv1_filterApplied=FALSE&C2_W12_V13_V14_tv1_firstSelected Row=&C2_W12_V13_V14_tv1_ctrlShiftKeyMode=&C2_W12_V13_V14_tv1_previousSelectedRange=&C2_W12_ V13_V14_tv1_isNavModeActivated=TRUE&C2_W12_V13_V14_tv1_multiParameter=0%2F%2F%2F%2F0%2F%2 F%2F%2F0%2F%2F%2F%2F0&thtmlbScrollAreaWidth=0&thtmlbScrollAreaHeight=0&LTX_PREFIX_ID=C1_W1_V 2_&C1_W1_V2_LTX_VETO_FLAG=&C1_W1_V2_ACTION_GUID=&C1_W1_V2_AC_OBJECT_KEY=&C1_W1_V2_A C_VALUE=&C1_W1_V2_AC_CONTAINER=&C1_W1_V2_MYITSLOCATION=&sap-ajax_request=X",


LAST);


 

// The incoming telephone call is accepting = ACCEPT web_custom_request("sam_js2bsp_sender.htm_15",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm? sap-session_access_token={AccessToken}=",


"Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t474.inf",


"Mode=HTML", "Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=Accept&n0=p1&v0=phone&n1=p2&v1={PhoneU ID}&n2=mimc_session_id&v2=s_100_Y2ICAGENT_{TIMESTRING_CALL}&n3=icwc_eventname&v3=com.sap.ic.ws b.action&n4=icwc_sam_message_listener&v4=icwc_mcm_client_event_listener&n5=_sam_bsp_session_queue &v5=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsa m_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&n6=_sam_message_sent_time&v6={DATESTRING}UTC",


LAST);


 

Telephone call to an external phone number


By these requests the Dial-Pad in the IC will open and a phone number is dialed.

 

web_url("dialPad.htm",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/iccmp_ccs/dialPad.htm?iccmp_ccs/dialPad.htm",


"Resource=0",


"RecContentType=text/html",


"Referer=",


"Snapshot=t57.inf",


"Mode=HTML",


LAST);


 

// timestring lr_param_sprintf("TIMESTRING","%s",function_timestring());

// date string definition lr_param_sprintf("DATESTRING","%s",function_datestring());

 

function_checkPhoneUID();

 

web_custom_request("sam_js2bsp_sender.htm_7",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm?sap-session_access_token={AccessToken}=", "Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t736.inf",


"Mode=HTML", "Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_s


ess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=browser_ping&n0=p1&v0={TIMESTRING}&n1=ic wc_eventname&v1=icwc.mcm.browser.ping&n2=icwc_sam_message_listener&v2=icwc_mcm_client_event_list ener&n3=_sam_bsp_session_queue&v3=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})"


"%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&n4=_sam_message_sent_time&v4={DATESTRING}UTC",


LAST);


 

lr_think_time(1);

// date string definition lr_param_sprintf("DATESTRING","%s",function_datestring());

 

function_checkPhoneUID();

 

web_custom_request("sam_js2bsp_sender.htm_8",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm?


sap-session_access_token={AccessToken}=",


"Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t738.inf",


"Mode=HTML",


"Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_s ess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=null&n0=_sam_js_poll&v0=true&n1=_sam_js_cl ient_queue_receiver_name&v1=CL_SAM_CLIENT_QUEUE_RECEIVER&n2=_sam_bsp_session_queue&v2=https% 3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_q ueue_cntrler.do%3Fsap-session_access_token%3D{AccessToken}%3D&"


"n3=_sam_message_sent_time&v3={DATESTRING}UTC",


LAST);


 

lr_param_sprintf("DATESTRING","%s",function_datestring());

 

// timestring

lr_param_sprintf("TIMESTRING","%s",function_timestring());

 

function_checkPhoneUID();

 

// Start call

web_custom_request("sam_js2bsp_sender.htm_9",

"URL=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_js2bsp_sender.htm?sap-session_access_token={AccessToken}=", "Method=POST",


"Resource=0",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Snapshot=t742.inf",


"Mode=HTML","Body=queue=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&type=text&data=Dial&n0=p1&v0=phone&n1=p3&v1={Rufnumm er}&n2=mimc_session_id&v2=s_100_Y2ICAGENT_{TIMESTRING_CALL}&n3=icwc_eventname&v3=com.sap.ic.ws b.action&n4=icwc_sam_message_listener&v4=icwc_mcm_client_event_listener&n5=_sam_bsp_session_queue &v5=https%3A%2F%2F{appserver_2}%2Fsap({SAPLocation1})"


"%2Fbc%2Fbsp%2Fsap%2Fsam_sess_queue%2Fsam_session_queue_cntrler.do%3Fsap- session_access_token%3D{AccessToken}%3D&n6=_sam_message_sent_time&v6={DATESTRING}UTC",


EXTRARES,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/nova/styling/table_columnaction.gif", "Referer=http://{appserver}/sap({SAPBCTWO75})/bc/bsp/sap/crm_ui_frame/BSPWDApplication.do?sap- client=100&sap-domainrelax=min&sap-language=DE", ENDITEM,


"Url=/SAP(====)/BC/BSP/SAP/thtmlb_styles/sap_skins/nova/_images/tableColumnBG_hov.gif", "Referer=http://{appserver}/sap({SAPBCTWO75})/bc/bsp/sap/crm_ui_frame/BSPWDApplication.do?sap- client=100&sap-domainrelax=min&sap-language=DE", ENDITEM,


LAST);


 

User logout


For the logout all connections to CRM have to be terminated as well as for the communication channels.

 

// Closing the CRM session

web_submit_data("uif_callback_5",

"Action=https://{appserver}/sap({SAPSessionManager61}=)/webcuif/uif_callback?sap-client=100&sap- language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_FRAME&crm_controller=C1",


"Method=POST",


"RecContentType=text/plain",


"Referer=https://{appserver}/sap({SAPBCTWO11})/bc/bsp/sap/crm_ui_start/default.htm?crm- icsessionsyncid={ICSessionID}%20&crm-iccc=X&crm- icwscl=100&sapoutype=S&sapouid=50000166&saprole=Y2ICAGENT&crm- icsessionid=s_100_Y2ICAGENT_{TIMESTRING_CALL}",


"Snapshot=t529.inf",


"Mode=HTML",


ITEMDATA,


"Name=cmd",


"Value=logoff",


ENDITEM,


LAST);


 

// Closing the IC session (telephony communication) web_submit_data("sam_session_queue_cntrler.do",

"Action=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/sam_sess_queue/sam_session_queue_c ntrler.do?sap-client=100&sap-language=E&sap-sessioncmd=CLOSE",


"Method=POST",


"RecContentType=text/html", "Referer=https://{appserver}/sap({SAPLocation1})/bc/bsp/sap/crmcmp_ic_frame/mcmain_header.htm


"Mode=HTML",


ITEMDATA,


LAST);