Giter VIP home page Giter VIP logo

Comments (3)

skrusty avatar skrusty commented on June 14, 2024

What version of AsterNET.ARI are you using please? There was a problem in an older version that might have caused something like that.

from asternet.ari.

skrusty avatar skrusty commented on June 14, 2024

I build headers like so:

variables = new Dictionary <string, string>();
var counter = 0;
foreach (var h in _headers)
{
    variables.Add($"SIPADDHEADER{counter}", h);
    counter++;
}

where h is a string something like "headername: value"
then

 _client.Channels.OriginateWithId(
                    ChannelId,
                    "SIP/foo",
                    app: _ariAppName,
                    timeout: _timeout,
                    callerId: _callerId,
                    variables: variables);

from asternet.ari.

chasik avatar chasik commented on June 14, 2024

I downloaded from Nuget - version 1.1.0 - the last, as I understand it. After reading the article to clone the repository - the result is the same. The file has a title:

AsterNET ARI Framework Automatically generated file @ 12/10/2015 11:53:27

Asterisk version - tried as 12 and 13 (the latest version).
In our case, when serializing the dictionary we get a string without a key "variables" - a set of data transmitted in a dictionary of key/value (which is logical). If you use swager - online service at asterisk.org - there need to just format {"variables" : {"key1:val1", "key2:val2", "key3:val3"}}, but it passed only {"key1:val1", "key2:val2", "key3:val3"} and header not set (sorry my English). I add one row in method AddParametr (Command.cs):

        public void AddParameter(string name, object value, Middleware.ParameterType type)
        {
            if (type == ParameterType.RequestBody)
            {
                Request.RequestFormat = DataFormat.Json;

               var SetValuesDict = new Dictionary<string, object> { { "variables", value } };

                Request.AddParameter(name, JsonConvert.SerializeObject(SetValuesDict), (RestSharp.ParameterType)Enum.Parse(typeof(RestSharp.ParameterType), type.ToString()));
            }
            else
            {
                Request.AddParameter(name, value, (RestSharp.ParameterType)Enum.Parse(typeof(RestSharp.ParameterType), type.ToString()));
            }
        }

and all work good for my case... I do not want to go into the source code - I want to be updated with no problems .... Help, please ...

from asternet.ari.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.