ATAPI 1.2.0.0 Error on CallForward

Sep 4, 2014 at 2:34 PM
Hello
1) CallForward
We are trying to programm CallForwarding with Atapi, but we get some errors:

This is the code:
public bool CallForwarding (string line, string forwardingType, bool activateForward, string forwardDN)
    {
        try
        {
            foreach (TapiLine tLine in Global.tapiManager.Lines)
            {
                if (line == tLine.Addresses[0].ToString())
                {
                    line = tLine.ToString();
                }
            }
            TapiLine tapiLine = Global.tapiManager.GetLineByName(line, true);

            MakeCallParams mkcParams = new MakeCallParams();
            mkcParams.OriginationAddress = line;
            mkcParams.TargetAddress = forwardDN;

            ForwardInfo fwInfo= new ForwardInfo();
            fwInfo.DestinationAddress = forwardDN;

            if (forwardingType == "forwardImmediate")
            {
                fwInfo.ForwardMode = ForwardingMode.Unconditional;
            }
            else if (forwardingType == "forwardImmExt")
            {
                fwInfo.ForwardMode = ForwardingMode.UnconditionalExternal;
            }
            else
            {
                fwInfo.ForwardMode = ForwardingMode.UnconditionalInternal;
            }

            if (tapiLine != null)
            {
                if (activateForward == true)
                {
                    tapiLine.Forward(fwInfo, 0, mkcParams);
                }
                else
                {
                    tapiLine.CancelForward();
                }
                return true;
            }
        }
        catch (TapiException ex)
        {
            Log.Error(ex.Message, ex.InnerException);
        }
        return false;
    }
The CancelForward instruction is working fine.

On tapiLine.Forward(fwInfo, 0, mkcParams); if we put the 3rd parameter (mckParams) the error is:
The best overloaded method match for 'JulMar.Atapi.TapiLine.Forward(JulMar.Atapi.ForwardInfo[], int, JulMar.Atapi.MakeCallParams)' has some invalid arguments

Using tapiLine.Forward(fwInfo, 0); if we don't put the 3rd parameter (mckParams), the error is:
No overload for method 'Forward' takes 2 arguments.

According to the documentation this parameter should be optional:
Optional call parameters - only used if a consultation call is returned; otherwise ignored. May be null for default parameters

2) ATAPI Version 1.4.0.0
We are using the atapi dll version 1.2.0.0 and we were not able to download the versio 1.4.0.o from Codeplex web page https://atapi.codeplex.com/releases/view/106299. Is there other address to dwnload it?

Best regards
Delfim Pires
Coordinator
Sep 4, 2014 at 3:39 PM
Edited Sep 4, 2014 at 3:40 PM
Make your ForwardInfo an array instead of just a single item. Something like this:

tapiLine.Forward(new[] { fwInfo}, 0, mkcParams);

The latest version is added through Nuget (Manage Nuget ... on the references folder in your project) - search for ATAPI and you should find it.
Sep 5, 2014 at 2:25 PM
Hi Mark
Thank you for your help. It works.
Best regards
Delfim Pires