cancel
Showing results for 
Search instead for 
Did you mean: 

ICWeb Client, How check flashing buttons, before accepting a call?

Former Member
0 Kudos

Good morning,

I need with ABAP CODE, to check if there is the flashing button, before accepting call.

Do know anyone how check this state in the interection center?

To check if the call is accepted I use the following code:

data: ref_intman type ref to cl_crm_ic_interaction_manager.
 

ref_intman = cl_crm_ic_interaction_manager->get_instance( ).
 

check ref_intman->has_current_interaction( ) eq abap_true.

I need also to check if the user is ready or not ready to receive a call.

Many thanks.

Marc

Accepted Solutions (1)

Accepted Solutions (1)

VishnAndr
Active Contributor
0 Kudos

And as a last point.

Here is an example code how to check call state using standard classes:


DATA: lr_ccs_instance TYPE REF TO cl_iccmp_ccs,
      lr_contact TYPE REF TO cl_crm_ic_mcm_contact,
      lv_phoneid TYPE string.

lr_ccs ?= cl_iccmp_ccs=>get_instance( ).

lv_phoneid = lr_ccs->get_currentphoneid( ).
IF lv_phoneid IS NOT INITIAL. //no phone id => no current contact => no flashing buttons
   lr_contact ?= lr_ccs->get_contact( lv_phoneid ).
   CASE lr_contact->m_status.
      WHEN if_crm_ic_contact~c_status_started.
      //current contact has status ContactStarted (flashing buttons)
      //........
      WHEN if_crm_ic_contact~c_status_accepted.
      //current contact has status ContactAccepted (no flashing buttons)
      //........
   ENDCASE.
ENDIF.

Hope this will help you.

VishnAndr
Active Contributor
0 Kudos

Hi, Marc.

You've also wondered how to check is user ready or not ready. Here is an example.

 DATA: lr_bcb_user TYPE REF TO cl_bcb_user,
       lv_user TYPE string,
       lr_bcb_session TYPE REF TO cl_bcb_session,
       ls_current_workmode TYPE bcb_text_element.

 CALL METHOD cl_bcb_worker_session=>get_bcb_session
   EXPORTING
     cc_system   = 'bcm-test' //!!! here you should put you CMS id, bcm-test in my case
   RECEIVING
     bcb_session = lr_bcb_session.

 IF lr_bcb_session IS BOUND.
   TRY.
       lv_user = sy-uname.
       CREATE OBJECT lr_bcb_user
         EXPORTING
           session = lr_bcb_session
           userid  = lv_user.
       ls_current_workmode = lr_bcb_user->get_current_workmode( ).
       CASE ls_current_workmode-id.
         WHEN cl_bcb_user=>logged_off.
         // not logged in to CMS
         WHEN cl_bcb_user=>logged_on_ready.
        // logged on and ready
         WHEN cl_bcb_user=>logged_on_not_ready.
        // logged on and not ready
       ENDCASE.
     CATCH cx_bcb_exception.
   ENDTRY.
 ENDIF.

Hope this will help you.

Former Member
0 Kudos

Hello Andrei,

thanks a lot! I think this code is just right for my work!

I'll know soon if I resolve my problem!

I do not know how I would do without you, thanks to you I am learning to use the CRM IC framework.

See you soon

Marc

VishnAndr
Active Contributor
0 Kudos

You are welcome, Marc.

Former Member
0 Kudos

Good Morning Andrei,

I'm trying to implement the code, I have a problem with the definition of lr_ccs.

If I declare lr_ccs TYPE REF TO CL_ICCMP_CCS, but I didn't found the method lr_ccs->get_currentphoneid( ).

I saw that you convert with ?= the assign of the instance:

lr_ccs ?= cl_iccmp_ccs=>get_instance( ).

Could you say me what is the correct type of the object lr_ccs?

Many thanks

Marc

VishnAndr
Active Contributor
0 Kudos

What version of SAP CRM are you on? In my SAP CRM 7.0 with SP09 system it is in place.

Former Member
0 Kudos

My SAP CRM IS:

SAP_ABA 700 SAPKA70015 0015

I don't know but I don't fint the method I will try another solution, I will update you.

See you soon

Thanks

M

Former Member
0 Kudos

Good Morning Andrei,

I would like update you about the results of the ABAP code implementation according to your specifications.

1. to check if the user is ready or not ready, the code works perfectly, I'm able to check if the user in the session is Ready or not ready in run time using the cc_system of the customizing. Really Great!

2.The code works a part the method to get the ID of the contact. Infact in the class cl_iccmp_ccs I don't have the method GET_CURRENTPHONEID but only GET_CURRENTCHATID. So at the moment I'm not able to get the current ID phone contact to use the method lr_ccs->get_contact.

In my test, the private table m_contacts of the class cl_iccmp_ccs contains only one contact, so I read manually in debug mode the ID and forced it to the method get_contact and it works perfectly. So my only trouble is how get the currect active ID contact to pass it to the method get_contact.

I saw that in your code you have declared the instance lr_ccs_instance TYPE REF TO cl_iccmp_ccs, but in the code you have used the variable lr_ccs that is not declared, and you have set the instance with the conversion operator "?="; are you sure that the instance lr_ccs belongs to the class cl_iccmp_ccs or probable is a class inherited of cl_iccmp_ccs?

Many thanks

Marco

VishnAndr
Active Contributor
0 Kudos

Sorry Marc,

it's certainly should be the code

DATA: lr_ccs TYPE REF TO cl_iccmp_ccs,

instead of lr_ccs_instance declaration.

[Here is a screenshot |http://twitpic.com/8qi55g] from my system. The method GET_CURRENTPHONEID is there. So I believe that this is only the matter of versions. We have such versions:


SAP_ABA        701        0009        SAPKA70109 
SAP_BASIS      701        0009        SAPKB70109 
PI_BASIS       701        0009        SAPK-70109INPIBASIS 
ST-PI   2008_1_700        0004        SAPKITLRD4 
SAP_BS_FND     701        0009        SAPK-70109INSAPBSFND 
SAP_BW         701        0009        SAPKW70109 
SAP_AP         700        0023        SAPKNA7023 
WEBCUIF        700        0009        SAPK-70009INWEBCUIF 
BBPCRM         700        0009        SAPKU70009

Anyway this method only provides protected attribute m_phone_sessionid of the class. Do you have this attribute?

Former Member
0 Kudos

I saw your image Andrei, and I re-check the class CL_ICCMP_CCS but I didn't find the method probably because my ABAP version is 700 and your version is 701.

It's missed also the protected attribute called m_phone_sessionid.

In your Image I saw that the description of the method GET_CURRENTPHONEID is "Return the current chat session is" like the method GET_CURRENTCHATID that in my class is present.

This suggest that the method GET_CURRENTPHONEID was copied from GET_CURRENTCHATID.

I'ts possible that the method GET_CURRENTPHONEID is copied from the method GET_CURRENTCHATID in a custom way? I say this because I tried to modify the class CL_ICCMP_CCS and SAP don't block me so it's possible for me copy a method.

Kindly could you write me the code that valorize the attribute m_phone_sessionid?

I think that the attribute is valorized in the redefinition of the method IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT of the class CL_ICCMP_CCS.

Many thanks Andrei

Marc

VishnAndr
Active Contributor
0 Kudos

No, Marc, this is defenitely a standard method. Programmers at SAP also make mistakes not renaming methods when copying them Nobody is perfect.

The code in it is quite simple and similar to get_currentchatid:

METHOD get_currentphoneid.
   ev_phone_sessionid = m_phone_sessionid.
ENDMETHOD.

where ev_phone_sessionid is a returning paramater of the method with type STRING.

m_phone_sessionid in turn is a protected attribute of the class with type STRING.

It is filled in IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT method of the class in following way:

METHOD if_crm_ic_event_listener~handle_event.
....
 CASE event->get_name( ). 
..... 
   WHEN cl_crm_ic_mcm_contact=>c_event_accepted.
     event->get_param( EXPORTING name = 'Parameter1' IMPORTING value = itemchannel )."#EC NOTEXT
     IF itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_telephony OR
        itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_email OR
        itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_chat.
       event->get_param( EXPORTING name = 'Parameter2' IMPORTING value = itemid )."#EC NOTEXT
       contact = get_contact( itemid ).
       IF contact IS BOUND.
         contact->set_status( cl_crm_ic_mcm_contact=>c_status_accepted ).
       ELSE.
         var1 = itemid.
         cl_crm_ic_mcm_proxy=>addbspmsg( iv_msg_type   = 'W'
                                         iv_msg_number = 19
                                         iv_msg_v1     = var1
                                         iv_msg_v2     = ''
                                         iv_msg_v3     = ''
                                         iv_msg_v4     = '' ).
       ENDIF.

     ENDIF.
     IF itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_chat.
       m_chat_sessionid = itemid.
     ELSEIF itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_telephony.
       m_phone_sessionid = itemid.
     ENDIF.
   WHEN cl_crm_ic_mcm_contact=>c_event_ended. 
.... 
  ENDCASE.

ENDMETHOD.

Former Member
0 Kudos

I decided to modify the class CL_ICCMP_CCS ( link image at http://twitpic.com/8qxot4) like your CRM version so now I'm able to get current version of a call.

In the handle event of the class CL_ICCMP_CCS I added the following code for the events:

WHEN cl_crm_ic_mcm_contact=>c_event_started.

       CASE itemchannel.
          WHEN cl_crm_ic_mcm_contact=>c_channel_telephony.

            m_phone_sessionid = itemid.

WHEN cl_crm_ic_mcm_contact=>c_event_accepted.

      IF itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_telephony.
         m_phone_sessionid = itemid.
      ENDIF.

WHEN cl_crm_ic_mcm_contact=>c_event_ended.

      IF itemchannel EQ cl_crm_ic_mcm_contact=>c_channel_telephony.
          IF m_phone_sessionid = itemid.
            m_phone_sessionid = ''.
          ENDIF.
      ENDIF.

I have used the same code and the same position of the code like the standard (in my system standard) m_chat_sessionid parameters.

I hope add in the class the parameters myself don't create troubles for the future (like upgrades).

Now I test if it runs and I will update you.

See you soon.

Marc

Former Member
0 Kudos

Hi Andrei,

I would like to compliment with you about your technical and personal qualities.

I tested the last part and now I am able to check if the current conversation is started or accepted with the code:

lv_phoneid = lr_ccs->get_currentphoneid( ).

IF lv_phoneid IS NOT INITIAL.

lr_contact ?= lr_ccs->get_contact( lv_phoneid ).

I introduce myself, my name is Marco Sauro and I added you to linkedin network.

Regards

Marco

VishnAndr
Active Contributor
0 Kudos

Thank you, Marco.

Great to hear this! You're always welcome!

Former Member
0 Kudos

Hi Andrei,

I have one requirement to create interaction record when actual call ( ourbound call ) is happend.

could you please tell me what needs to be done.

Regards,

Nagendra

VishnAndr
Active Contributor
0 Kudos

Hello, Nagendra.

I think you should probably follow the logic described in the http://scn.sap.com/message/11098988#11098988 here in this thread. Subscribe to the event and create an interaction record there.

It seems that you better should start a new discussion where all members can participate on the topic. Thank you.

Former Member
0 Kudos

Hi Andrei,

Thank you very much for your reply.

Outbound Call

Once call get conected, I need to get caller id and call details from BCM system and need to save into intraction record because in future i need to have intraction record linked with caller id ( from BCM)  for further reports in the BCM.

Could you please help me on this requirment.

Answers (2)

Answers (2)

VishnAndr
Active Contributor
0 Kudos

Additionally, I'd like to mention where you can instantiate your class.

Add the entry into Start-Up Component in CMS Integration Profiles (SPRO -> CRM -> Basic Functions -> Communication Management Software Integration -> Define CMS Integration Profiles) under your CMS profile. Enter your class there. And in Initialize method subscribe to desired events.

Constants for events:

ContactStarted = IF_CRM_IC_CONTACT~C_EVENT_STARTED (when contact just arrives to an agent; buttons start flashing)

ContactAccepted = IF_CRM_IC_CONTACT~C_EVENT_ACCEPTED (when an agent presses the accept button; buttons stop flashing)

ContactEnded = IF_CRM_IC_CONTACT~C_EVENT_ENDED (when an agent doesn't accept a call; buttons stop flashing)

VishnAndr
Active Contributor
0 Kudos

Hello, Marc.

I remember that I've promised you to give some inputs on the subject in other thread. But was short of time, sorry.

Some thoughts what you can do without using any existed (I hope they do, but have no time to find them right now) methods and classes.

Buttons start flashing with IC event ContactStarted.

And finish flashing when contact is accepted by user (IC event ContactAccepted).

So you can create your own class which will instantiate in the very beginning of IC agent session (as soon as he logs in). This class should implement IF_CRM_IC_EVENT_LISTENER interface in it. Then subscribe to these two events (may be you'll need more; see later on). When ContactStarted event will be raised you'll get this in you handle_event method. Set some flag then (let's say gf_contact_started). So calling some static method of this class which returns the current instance and its flag will let you know are buttons flashing or not.

When call is accepted the ContactAccepted event will be raised and you'll get it in your handle_event method too. On this event clear the flag. And you're almostly done. One thing to think about is what event will be raised when agent won't accept a call and buttons will stop flashing in a while. Try to find out it putting a breakpoint in CL_CRM_IC_EVENT_SRV->IF_CRM_IC_EVENT_SRV~RAISE and reproduce the situation.

BTW, you can find constants for names of events in cl_crm_ic_interaction_manager class, I think.

Hope this will help you.