Skip to content

Commit

Permalink
Add conference snippet to make call with friendly name
Browse files Browse the repository at this point in the history
  • Loading branch information
hortega committed Aug 2, 2017
1 parent bc0b03f commit 7f765e4
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rest/participant/list-post-example-1/list-post-example-1.3.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.conferences('AgentConf12')
.participants.create({
to: '+15624421212',
from: '+18180021216'
})
.then((participant) => console.log(participant.sid));
24 changes: 24 additions & 0 deletions rest/participant/list-post-example-1/list-post-example-1.5.x.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Conference;
using Twilio.Types;

class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/console
const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
const string authToken = "your_auth_token";
TwilioClient.Init(accountSid, authToken);

const string conferenceFriendlyName = "AgentConf12";
var from = new PhoneNumber("+18180021216");
var to = new PhoneNumber("+15624421212");
var participant = ParticipantResource.Create(
conferenceFriendlyName, from, to);

Console.WriteLine(participant.CallSid);
}
}
21 changes: 21 additions & 0 deletions rest/participant/list-post-example-1/list-post-example-1.5.x.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$participant = $client
->conferences("AgentConf12")
->participants
->create([
'from' => '+18180021216',
'to' => '+15624421212'
]);

echo $participant->callSid;
18 changes: 18 additions & 0 deletions rest/participant/list-post-example-1/list-post-example-1.5.x.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@participant = @client.api.conferences('AgentConf12')
.participants
.create(
from: '+18180021216',
to: '+15624421212'
)

puts @participant.call_sid
16 changes: 16 additions & 0 deletions rest/participant/list-post-example-1/list-post-example-1.6.x.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

fromNumber = "+18180021216"
toNumber = "+15624421212"
participant = client \
.conferences("AgentConf12") \
.participants \
.create(fromNumber, toNumber)

print(participant.call_sid)
23 changes: 23 additions & 0 deletions rest/participant/list-post-example-1/list-post-example-1.7.x.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.conference.Participant;
import com.twilio.type.PhoneNumber;

public class Example {
/// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
public static final String AUTH_TOKEN = "your_auth_token";

public static void main(String[] args) {
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

String conferenceFriendlyName = "AgentConf12";
PhoneNumber from = new PhoneNumber("+18180021216");
PhoneNumber to = new PhoneNumber("+15624421212");
Participant participant = Participant
.creator(conferenceFriendlyName, from, to)
.create();

System.out.println(participant.getCallSid());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences/AgentConf12/Participants.json' -X POST \
--data-urlencode 'To=+15624421212' \
--data-urlencode 'From=+18180021216' \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences/AgentConf12/Participants' -X POST \
--data-urlencode 'To=+15624421212' \
--data-urlencode 'From=+18180021216' \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
4 changes: 4 additions & 0 deletions rest/participant/list-post-example-1/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Make Outbound Conference Call",
"type": "server"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"conference_sid": "CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"date_created": "Wed, 18 Aug 2010 20:20:10 +0000",
"date_updated": "Wed, 18 Aug 2010 20:23:06 +0000",
"end_conference_on_exit": true,
"muted": true,
"hold": false,
"start_conference_on_enter": true,
"uri": "2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences/CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<TwilioResponse>
<Participant>
<CallSid>CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</CallSid>
<ConferenceSid>CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</ConferenceSid>
<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
<Muted>true</Muted>
<Hold>false</Hold>
<EndConferenceOnExit>true</EndConferenceOnExit>
<StartConferenceOnEnter>true</StartConferenceOnEnter>
<DateCreated>Wed, 18 Aug 2010 20:20:10 +0000</DateCreated>
<DateUpdated>Wed, 18 Aug 2010 20:23:23 +0000</DateUpdated>
<Uri>2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conferences/CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</Uri>
</Participant>
</TwilioResponse>

0 comments on commit 7f765e4

Please sign in to comment.