C# - Creating Conference Call v14

Discussion in 'CRM / Helpdesk / App Integration' started by Waseem, May 10, 2017.

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

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    Hi

    I am trying to create a conference call but can't seem to get it to work the relevant bit of my code is below , nothing happens when I run the code.

    The documentation says the IsGateway needs to be false that is why i am setting it like that below , although once set i dont need to run this bit of the code again.


    Code:
    PhoneSystem.ApplicationName = "pleasework";
                    PhoneSystem.CfgServerHost = "127.0.0.1";
                    PhoneSystem.CfgServerPort = 5485;
                    PhoneSystem.CfgServerUser = "cfguser_default";
                    PhoneSystem.CfgServerPassword = "pwhshhlew3va";
                    
              
                    bool found = false;
    
    
                    ConferencePlaceExtension[] conf =   PhoneSystem.Root.GetConferencePlaceExtensions();
    
    
                    foreach (ConferencePlaceExtension confs in conf)
                    {
    
                        Console.Write(confs.Number);
                        Console.WriteLine('t');
                        Console.WriteLine();
    
                        Console.Write(confs.IsGateway);
    
                        confs.IsGateway = false;
                        confs.Save();
    
                    }
    
                    PBXConnection pbx = CreatePbxConn();
                    Dictionary<string, string> t = new Dictionary<string, string>();
                   t.Add("tojoin", "12");
                    t.Add("instant", "1");
                
    
                  pbx.MakeCall("70",t);
                ///    pbx.MakeCall("70", "12");
    @edossantos you helped me before not sure if you can on this one.
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,058
    Likes Received:
    75
    Hi @Waseem,

    This is from the documentation of the MakeCall method:
    So, can you please try with this?
    Code:
    pbx.MakeCall("70", {"tojoin"="12", "PIN"="111", "noname"="1"}); // First participant is ext 12
    pbx.MakeCall("70", {"tojoin"="13", PIN="111"}); // Next participant is ext 13
    pbx.MakeCall("70", {"tojoin"="14", PIN="111"}); // Next participant is ext 14
    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Waseem

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    Thanks @edossantos

    See this screenshot when i tried it like the documentation states I can't build it


    Ok the screenshot doesn't work .. but it says invalid expression '{' and it won't build .. that was the first thing that confused me so thats why i tried just adding the dictionary

    Basically it is not liking the part after "70",
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,058
    Likes Received:
    75
    What version of .NET Framework is targeting your project? I think initializers were introduced recently, so if you're using for example .NET 2.0 it will not work. Please check that, upgrade the project to .NET Framework 4.6 or later.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Waseem

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    it was .Net 4.5 now I have changed it to 4.6.1 and still the same I will keep looking i guess
     
  6. Waseem

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    Code below works ,


    Code:
       pbx.MakeCall("70",
                                  new Dictionary<string, string>
            {
                { "tojoin", "12" }
    
            }
                        
                        );
     
  7. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,058
    Likes Received:
    75
    Try this:
    Code:
    pbx.MakeCall("70", new Dictionary<string, string>{{"tojoin", "12"}, {"PIN", "111"}, {"noname", "1"}}); // First participant is ext 12
    pbx.MakeCall("70", new Dictionary<string, string>{{"tojoin", "13"}, {"PIN", "111"}}); // Next participant is ext 13
    pbx.MakeCall("70", new Dictionary<string, string>{{"tojoin", "14"}, {"PIN", "111"}}); // Next participant is ext 14
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Waseem

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    I lie this does not work I hadn't re-built my codebase , and the above answer doesn't work either very odd ..
     
  9. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,058
    Likes Received:
    75
    The code I suggested doesn't work in runtime? Or you can't even build it?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Waseem

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    Yeah sorry my code (2 posts up) and the one you suggested both build , but similar to my original code nothing actually happens ,

    I looked in the Activity Log and found this:


    Code:
    10-May-2017 13:33:30.993   PBX has dropped a message with 'User-Agent: friendly-scanner' from IP 212.XXX.XXX.XX because it is on blocked UAs list
    10-May-2017 13:29:21.200   [CM504002]: Endpoint Extn:10: a contact is unregistered. Contact(s): [sip:10@127.0.0.1:5488 / 10]
     
  11. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,058
    Likes Received:
    75
    It seems you're having problems with the 3CX blacklist. You need to fix that first.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Waseem

    Joined:
    Mar 21, 2017
    Messages:
    16
    Likes Received:
    0
    I removed the UA from the parameters list so I don't get that error message anymore in the log

    Code:
    10-May-2017 14:39:32.290   [EC100009]: External application [DESKTOP-VTUSPI8:0/pleasework] is disconnected:
    
    On a point of note , before removing it from the parameters and after a normal MakeCall("70","12") works fine
     
  13. voiptoys

    voiptoys Member

    Joined:
    Feb 13, 2013
    Messages:
    478
    Likes Received:
    79
    Doesn't work for me. Does nothing. Standard MakeCall works, but not this dictionary syntax. It compiles fine. It would be helpful to understand what the parameters mean. For example, is the PIN the Extension's VMPIN? And who's PIN is it, the person placing the call, or the person receiving the call? And what is the {"noname", "1"} parameter for? If we are calling an outside party, do we need the PIN parameter?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,058
    Likes Received:
    75
    Hi @voiptoys,

    This case is to create a conference. The first extension must be a conference place extension, and then you can set the other parameters in a Dictionary. The parameter "noname"="1" means that "conference place will not ask new memebers to pronounce name before entering this conference call but will ask to confirm participation. Will inform participants about joining and leaving but without name."

    The "tojoin" is the number to call to join to this conference, while "PIN" is the conference PIN and not the voicemail PIN.

    This is all documented in the 3CX Call Control API for v14 documentation. Please note that the docs for v15 don't have these details anymore...

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. voiptoys

    voiptoys Member

    Joined:
    Feb 13, 2013
    Messages:
    478
    Likes Received:
    79
    Hi Ernesto,

    I reviewed the API documentation and tried 1000 different iterations and couldn't get it to work. It just does nothing. Curiously, after Googling I found a post that said ,according to 3CX support, that this syntax is no longer supported in spite of the syntax being mentioned in the documentation. Perhaps that's why it's no longer in the V15 documentation.

    I did see other posts that suggested I could perform a simple MakeCall("700**100", "101"). But this doesn't seem to work either. I saw yet another post that suggested you must include the conference PIN following the ID. For example 100*0000. However, nothing I have tried works. Using the simplified syntax I get "Forbidden" in the logs suggesting that perhaps I've not specified the PIN syntax correctly?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. voiptoys

    voiptoys Member

    Joined:
    Feb 13, 2013
    Messages:
    478
    Likes Received:
    79
    After much testing I found something that works (with some limitations). My production PBX is running V15. We have 4 digit extensions. My conference extension is 7000 and my conference PIN is 0000. In the example below I specified extensions 1001 and 1005 as the participants for the conference call.

    MakeCall("7000*333*0000", "1001");
    MakeCall("7000*333*0000", "1005");

    I had to supply all the parameters for both participants or we didn't get prompted to accept the conference call (press *). I could not find a way to automatically send the * and immediately be logged into the conference call. But the participants did not need to know the conference ID (333 in this case).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. voiptoys

    voiptoys Member

    Joined:
    Feb 13, 2013
    Messages:
    478
    Likes Received:
    79
    It's not an "instant" conference call like I had hoped. It does require participants to accept the call, but it's pretty dang close to what I was shooting for, and I didn't even have to write a new overload for MakeCall in our VoIPTools Relay. That means our HTTP API should work as well, with some minor changes.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.