Gateway.OutboundParams Property

Discussion in 'CRM / Helpdesk / App Integration' started by pat71, Dec 6, 2016.

Thread Status:
Not open for further replies.
  1. pat71

    Joined:
    Mar 17, 2016
    Messages:
    44
    Likes Received:
    0
    Hi,

    Any one knows how to use Gateway. OutboundParams Property to change SIP string.

    Many thanks,
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,254
    Likes Received:
    97
    Hi there,

    That property returns an array of "TCX.Configuration.GatewayParameterBinding". You can iterate the array until you find the property you need to change, and then change the object accordingly.

    It is suggested that you debug it with Visual Studio, so you see the properties values, and you know how to identify each parameter.

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. pat71

    Joined:
    Mar 17, 2016
    Messages:
    44
    Likes Received:
    0
    Hi,
    I did that, but it just dos not want to save the changes I want to change UserFromPart and I want it to be save and reflected in the PBX setting. Is that possible.

    Code:
     foreach (var rct in ps.GetGateways())
    //                                    {
    //                                        rct.OutboundCallerID = "0842003325";
    //                                        rct.Save();
                                        
    //                                        foreach (var x in rct.OutboundParams)
    //                                        {
                                            
    //                                            if (x.Param.Name.ToString() == "FromUserPart")
    //                                            {
    //                                               // if (Code.GetExtCallerIDsettingByMexMobile(args[3]))
    //                                                    x.Value = x.Param.PossibleValuesAsOutbound[2];
                                                
    //                                                //else
    //                                               // {
    //                                                 //   x.Value = x.Param.PossibleValuesAsOutbound[0];
    //                                               // }
    //                           
    //                                                rct.Save();
    //                                                x.Value = x.Param.PossibleValuesAsOutbound[2];
    //                                                rct.Save();
    //                                             
    //                                            }
    //                                        }
    //                                    }
    Is that the right way?

    Thanks for your help.
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,254
    Likes Received:
    97
    Hello, you code is all commented out. Is that how you have it? In that case the code might not be executing at all...

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.