Skip to Content

Outbound call CTI - any examples?

Hi team,

we are having an opportunity that needs CTI adapter for Outbound calls, but throughout all the ducuments I've seen, there is no example of how is the dialout class coded.

Is there any example so I can understand how "the logic" is turning into code?

I do have a coding background, but I do not know what the class needs to be declared, before the call goes out of C4C.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 05, 2017 at 10:12 AM

    Wow, thank you for this !

    So, I will contact you to tell me what are the necessary information that the customer needs to provide me for the implementation.

    BR,
    .CV

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2017 at 08:42 AM

    Hi,

    You should download CODCTCON1405SP00_0-20012367.EXE from sap support area. This is C# solution where you should implement "dialOut" method.

    Please contact me again (linkedin or email) if you have any questions with CTI outbound since I have experience with this and know all issues that you may face during this implementation of outbound call.

    br,

    Zoran

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2017 at 10:06 AM
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    using System.Net;
    using System.Runtime.InteropServices;
    
    namespace SAP.COD.CTI.Connector
    {
        public class OutboundCallHandler
        {
            Logger logUtil;
    //Add constructor to initiate logging
            public OutboundCallHandler()
            {
                logUtil = new Logger();
            }
            //Destructor
            ~OutboundCallHandler()
            {
                logUtil.Close(); 
            }
            public bool dialOut(string dialData)
            {
            logUtil.writeLog("Dialed number: " + dialData);
    	logUtil.writeLog("I am here in CTI outbound call " );
    	sendInboundCall(dialData);
    	return true;
            }
    	public void sendInboundCall(string firstNumber)
    		{
    	var url = $<a href="http://localhost:36726/?CID=CISCO9876∾tion_code=CALL_CONNECTED&ANI={firstNumber}">http://localhost:36726/?CID=CISCO9876∾tion_code=CALL_CONNECTED&ANI={firstNumber}</a>;			HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(url);
    	myReq.BeginGetResponse(new AsyncCallback(FinishWebRequest), myReq);
    		}
    	static void FinishWebRequest(IAsyncResult result)
    		{
    		try
    		{
    HttpWebResponse response = (HttpWebResponse)(result.AsyncState as HttpWebRequest).EndGetResponse(result);
    using (StreamReader SR = new StreamReader(response.GetResponseStream()))
    				{
    				var responseString = SR.ReadToEnd();
    				Console.WriteLine(responseString);
    
    				Console.WriteLine("Success!!!");
    				}
    			}
    			catch
    			{
    				Console.WriteLine("Communication error!!!");
    			}
    		}
    	}
    }
    

    Logger class is part of solution which I mention above.

    As I mention there are a lots of things to make outbound call work. Please contact me directly if you need some help for this.

    This example is sending data to CISCO custom listener

    Add comment
    10|10000 characters needed characters exceeded