RoutableResourceRouteFull Method (RoutableResource) |
Namespace: VoiceElements.Client
Routable Resource
This is the Routable Resource to which you would like to route. The resource from which you call this method becomes the first one in the route, the one specified by this parameter is the target or second in the route.Exception | Condition |
---|---|
Exception |
public static void MakeTwoCallsAndRoute() { TelephonyServer m_TelephonyServer = new TelephonyServer();// To get a channel, you must first get a link to a Telephony Server. You may need to pass a username password here. ChannelResource m_OutboundChannelResource1 = m_TelephonyServer.GetChannel();// Get first channel resource from the server ChannelResource m_OutboundChannelResource2 = m_TelephonyServer.GetChannel();// Get second channel resource from the server try { // Dial an outbound number with the first channel m_OutboundChannelResource1.Dial("4155551212"); // Dial an outbound number with the second channel m_OutboundChannelResource2.Dial("2135551212"); // In this case, we will not look at dial result for simplicity and only route the two together // They will hear each other dial and ring m_OutboundChannelResource1.RouteFull(m_OutboundChannelResource2); // *** Insert a loop to wait for a hangup or other event here while the two parties are talking } finally { // Once the call is complete, you should clear out the routes using the StopListener first to stop any channel listening to this one. m_OutboundChannelResource1.StopListener(m_OutboundChannelResource2); m_OutboundChannelResource2.StopListener(m_OutboundChannelResource1); // Then route each channel back to their dedicated voice resource to ensure they can be played to successfully m_OutboundChannelResource1.RouteFull(m_OutboundChannelResource1.VoiceResource); m_OutboundChannelResource2.RouteFull(m_OutboundChannelResource2.VoiceResource); } }