ruby - Twilio multiple treads to have each call have 1 process -
using ruby, sinatra, , twilio rest api, i'm coding customer service line company. when incoming call received, customer put on hold in < conference > verb, while application makes outgoing call agent. if accepts call, calls bridged.
i currently have 3 conference rooms (tech supp, sales, , mobile supp) created linear program. if conference room busy while call comes in requesting occupied room, can't reach agent, problematic.
my question : can i/how create thread in ruby each incoming call has own independent process?
my reasoning behind : once each call has thread, can create room called "name of department" + "@process.id".
for example : (also adding randomly generated 7-digit number make each conference name make 100% unique.
@random = random.rand(10_000_000 - 1_000_000) + 1_000_000
puts @random
< dial >
< conference > 'tech supp' + process_id \ + @random< /conference >
< /dial >
twilio evangelist here.
two ideas here. rather getting threads, can messy, quickly, why not create different conference room using inbound callers callsid. i've created systems similar describe before using technique. system catalogs each callsid arrives can go later , connect , agent conference.
another option might use queue. when new call dials in, drop them in queue (or different queues if want) , can wait there until agent ready. agent can pick next caller out of queue speak with.
this howto on using <queue> might helpful:
http://www.twilio.com/docs/howto/callqueue
hope helps.
Comments
Post a Comment