1
votes

I am having trouble creating a Conference Participant using the ReST API in twilio. The following is my request:

participant = ParticipantResource.Create(
                    new CreateParticipantOptions(
                        "conferenceName",
                        new PhoneNumber("client:791ecf-263c-49eb-9b9b-b6a265ee28d8"),
                        new PhoneNumber("client:59191ecf-263c-49eb-9b9b-b6a265ee28d8?agentFirstName=Michael&agentLastName=Scott++"))
                    {
                        Beep = Conference.BeepEnum.True.ToString(),
                        EndConferenceOnExit = true,
                        ConferenceStatusCallback = new Uri(statusCallbackUrl),
                        ConferenceStatusCallbackMethod = HttpMethod.Post,
                        ConferenceStatusCallbackEvent = new List<string>()
                        {
                            Conference.EventEnum.Start.ToString(),
                            Conference.EventEnum.Join.ToString(),
                            Conference.EventEnum.Leave.ToString(),
                            Conference.EventEnum.End.ToString()
                        }
                    }
                );

I believe this is the correct way to invoke this method to create a participant. I want to dial from agent 1 to agent 2, in order to get agent 2 into the conference call.

The conference call, create participant reference that I have followed is: https://www.twilio.com/docs/voice/api/conference-participant-resource

I want to pass the custom parameters to agent 2 who is logged in from the web client, in order to show agent 2 who is calling him.

1
You posted an answer the same time you posted the question, why, I am confused :)Trevor
@Çöđěxěŕ I did so, cause if someone else comes across the same problem, this solution will be of help :)Sylens

1 Answers

1
votes

The code implementation was correct, however you cannot provide client names with hypens "-". Although this works when returning TwiML via a callback URL, it doesn't work via the ReST API.

  • The client name can only be alphanumeric and underscores.
  • Custom params cannot contain anything other than alphanumeric characters and underscores as well.
  • Custom parameters cannot have null values ex: param1=Hello&param2=&param3=World here param 2 is empty.

An example of a correct client reference would be

new PhoneNumber("client:59191ecf_263c_49eb_9b9b_b6a265ee28d8?agentFirstName=Michael&agentLastName=Scott"))

p.s. Make sure your capability token is also created with the client id without hyphens.