Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Extension.ForwardingRules always returns an empty list (Solved)

Discussion in 'CRM / Helpdesk / App Integration' started by R. Henriksen, Dec 19, 2016.

Thread Status:
Not open for further replies.
  1. R. Henriksen

    Joined:
    Dec 19, 2016
    Messages:
    3
    Likes Received:
    1
    Hi

    The property Extension.ForwardingRules always returns an empty list.

    I have upgraded to v15 and when using the 3CX Configuration and Call Control API v2.0.0.0 (v15) the ForwardingRules property always returns an empty list.

    If I use the v1.6.0.0 (v14) API against the same installation the method returns a list of ForwardingRules as expected.

    I have also tried the DisplayAll OMSample with the same result.

    Any suggestions?
    Best regards
     
    apldoor likes this.
  2. pj3cx

    pj3cx Active Member

    Joined:
    Aug 1, 2013
    Messages:
    646
    Likes Received:
    1
    Hi R. Henriksen,
    Indeed I replicated this issue with the Call Control API sample and reported this to R&D.
    Thanks for the report, will get back to you when something new on this matter.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. pj3cx

    pj3cx Active Member

    Joined:
    Aug 1, 2013
    Messages:
    646
    Likes Received:
    1
    @R. Henriksen
    The correct way to list forwarding rules is the following:

    Current code:
    foreach (ExtensionRule er in e.ForwardingRules)
    {
    System.Console.WriteLine("\t\t\t\t" + er);
    }

    Replace with:
    extProfiles = e.FwdProfiles;
    foreach (FwdProfile extProfile in extProfiles)
    {
    extRuleList = extProfile.ForwardingRules;

    foreach (ExtensionRule er in extRuleList)
    {
    System.Console.WriteLine("\t\t\t\t" + er);
    }
    }

    And on top of sample, below
    PhoneSystem ps = PhoneSystem.Root;
    add
    FwdProfile[] extProfiles;
    ExtensionRule[] extRuleList;
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.