Click or drag to resize

RoutableResourceRouteFull Method (RoutableResource)

Completes a full route between two Routable Resources. Both channels then listen to each other.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public void RouteFull(
	RoutableResource routableResource
)

Parameters

routableResource
Type: VoiceElements.ClientRoutableResource

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.
Exceptions
ExceptionCondition
Exception
Remarks
The RouteFull method routes the transmit timeslots of both resources together. This will allow a Routable Resource to listen to another resource. It will also allow the other resource to listen to the first resource.

Routing Resources - When to Use It

This method is used to "connect two callers," or to route a caller to an IVR or application to provide audio. This method is the cornerstone of the majority of telephony applications, as it is the bridge to connect callers and audio.

Full Route vs Half Route

A full route allows both parties to listen to each other, while a Half Route will only allow one party to listen to the other. This distinction should be decided in each case you want to do a route.

Examples
The example below shows how to route two resources together. This simple code gets two Channel Resources, then executes a Dial Method on each to place two separate outbound calls and then lastly executes the full route. Note that typically, you would want to look at Dial Result before routing, but for simplicity, we only route the calls together below.
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);
    }
}
See Also