• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

C# - Creating Conference Call v14

Status
Not open for further replies.

Waseem

Joined
Mar 21, 2017
Messages
16
Reaction score
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.
 
Hi @Waseem,

This is from the documentation of the MakeCall method:
Conference place 701 is defined in the system and there is no conference call on this place
MakeCall("701", {"tojoin"="100", "PIN"="111", "noname"="1"});
Will initiate new conference call and call extension 100 to join it as first member.
PIN number of conference will be set to "111". New members will not be asked to pronounce name
New member can join to this conference using Conference gateway extension by entering 111 as PIN of conference.
subsequent call to: MakeCall("701", {"tojoin"="101", PIN="111"});
will call extension 101 and will join it to the conference
MakeCall("701", {"tojoin"="102", PIN="111"});
will call extension 102 and will join it to the conference
requests to make call will be ignored in case if PIN number is not correct.
If PIN is set to empty or not specified then this conference will not be accessible by making call to Conference gateway because there is no way to enter empty pin number and will be treated as public conference (means drect call to place is allowed during this conference
When conference is finished (all participants left the conference conference place become unavailable for direct calls (from phones) marked as free and next call to "MakeCall" or call routed by conference gateway may occupy the place.

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.
 
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",
 
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.
 
it was .Net 4.5 now I have changed it to 4.6.1 and still the same I will keep looking i guess
 
Code below works ,


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

        }
                    
                    );
 
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
 
Code below works ,


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

        }
                   
                    );

I lie this does not work I hadn't re-built my codebase , and the above answer doesn't work either very odd ..
 
The code I suggested doesn't work in runtime? Or you can't even build it?
 
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:[email protected]:5488 / 10]
 
It seems you're having problems with the 3CX blacklist. You need to fix that first.
 
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
 
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?
 
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.
 
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?
 
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).
 
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.
 
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.