1
Vote

how to GetVar action use?

description

hello.

I want to get the value of the channel variable after event Dial.

i set channel value
[from-pstn-custom]
exten => _X.,1,Set(__ORIGINAL_DID33=${EXTEN})
exten => _X.,n,goto(ext-did,${EXTEN},1)

in code
    void manager_Dial(object sender, DialEvent e)
    {
        string ordid = "";
        ordid = GetVar(e.Channel, "ORIGINAL_DID33");
        MessageBox.Show(ordid);
    }


    private string GetVar(string channel, string varname)
    {
        string result = "";
        try
        {
            Manager.Action.GetVarAction gv = new Manager.Action.GetVarAction(channel, varname);
            AsterNET.Manager.Response.ManagerResponse mr = manager.SendAction(gv);
            result = mr.Attributes[varname];
        }
        catch (Exception ex)
        { }
        return result;
    }
but, I always get Response TimeOut Exception

in telnet

Action: GetVar
Channel: Local/033@from-queue-000001a3;2
Variable: ORIGINAL_DID33

returns the value of the variable ORIGINAL_DID33

comments