Call

The Call Rule will initiate an outbound call to a Contact from your account. Please check messageParts if you haven't yet, as they will be included in the explanation of this rule.

Structure

As you can see in the XML Structure below, this Call Rule has the following elements. None of them are mandatory but they make the Call Rule really flexible and useful:

  • callerMessage: This will be the message which will be played to the calling party when a call is in progress.
  • calledMessage: This will be the message which will be played to the called party when the call is forwarded to them once the phone is ANSWERED.
  • eventHandler: This is the element which will handle the different events in a call. These events allow different actions to executed dependent upon the result of the call e.g. ANSWERED or BUSY
    • callEvent: These specify the route that will be taken in the callflow dependent upon the call result 
      • result: You can combine these values separated by | (pipe). The possible values are:
        • ANSWERED: If the phone number being called is answered - either by a person or IVR
        • BUSY: If the phone number being called is BUSY.
        • REJECTED: If the person being called REJECTs the call
        • NO_ANSWER: If the phone number being called is not answered, and the call rings out
        • CANCELLED: If the call is CANCELLED by the caller
      • action: The type we want to manage in this callEvent. At the moment we have only "onMatchResult".
    • failure: The Call will go out through this event if none of the previous events added to the Call Rule are matched.
<call id="call_1" label="Call" record="true" recordingLabel="My_recorded_message" recordCallNotificationLabel="defaultRecordMessage" sendCallAlert="NONE" destinationPhoneNumber="?" destinationContactId="?" destinationContactName="?">
    <callerMessage>
        <!-- messageParts -->
    </callerMessage>
    <calledMessage>
        <!-- messageParts -->
    </calledMessage>
    <eventHandlers>
        <callEvent action="onMatchResult" result="ANSWERED|BUSY">
            <!-- Rules -->
        </callEvent>
        <callEvent action="onMatchResult" result="NO_ANSWER">
            <!--- Rules -->
        </callEvent>
        <failure id="failure_1" label="Failure" attempts="3">
            <failureMessage>
                <!-- messageParts -->
            </failureMessage>
            <!-- Rules -->
        </failure>
    </eventHandlers>
 </call>

Learn more about the messageParts.

The Call Rule has the following attributes in the XML:

AttributeDescriptionMandatoryDefault

record

If set to "true", the call will be recorded. If the "record" attribute is "true" it is mandatory to specify the "recordCallNotificationLabel" element.YESN/A

recordingLabel

If record is set to "true" then you can set a Label for the recording of the call that can be used to reference the recording at a later time.NOfalse

recordCallNotificationLabel

The recorded message which will be played to the Caller to warn them that the call will be recorded. If you wish to use the default IOVOX message then this must be set to "defaultRecordMessage". Any custom messages that you wish to use need to be validated by IOVOX prior to being used in this attribute. Please raise a support ticket with the Sound File (in MP3 format) to have this validatedNO(default IOVOX message)

sendCallAlert

There are 4 possible values:

  • NONE - This will disable the call alerts.
  • MISSED_CALLS - This will send an email to the forwarding Contact's primary email address when the call is missed.
  • ALL_CALLS - This will send an email to the forwarding Contact's primary email for every call received and missed.
  • MISSED_CALLS_NO_WITHHELD - This will send an email to the forwarding Contact's primary email for every missed call which didn't come from a withheld number.
YESN/A

destinationPhoneNumber

This is the destination phone number which we will make the call to. This phone number must belong to a Contact. If not, the call will not be made so this field needs to be in combination with destinationContactId or destinationContactNameYESN/A

destinationContactId

This is the Contact's unique ID that can be provided when creating Contacts via the web portal, or the API. If you wish to refer to a particular contact this is the best way as we allow Contacts with the same contact name to be created in our platform. We do allow contacts to be created without an ID in the portal but the contacts without Contact ID set will not be able to be referred to via the API. Therefore we strongly advise providing a unique contact ID with any new contacts that are created.YESN/A

destinationContactName

This is the Contact's Display Name. You can have multiple contacts with the same name so if you decide to use this attribute in combination with destinationPhoneNumber then the first match with both details will be the one to be used.YESN/A
timeoutThis is the number of seconds, including connection time and ringing, before this rule times out and continues to the next rule. Calls which reach the Timeout limit will exit through the NO ANSWER callEvent outcome (if specified). 0 is the default and means IOVOX does not determine this. In this instance a NO ANSWER occurs when the terminating carrier abandons the call.NO0
callAlertDestinationTypeAllows sending of missed call email alerts to the PRIMARY or SECONDARY email address of a Contact. Possible values are PRIMARY, SECONDARY, BOTH. Defaults to PRIMARY.NOPRIMARY
callAlertDestinationBehaviourWhen a Contact has multiple email addresses of a certain type, this attribute allows deciding on whether only the FIRST one receives the missed call email alert, or ALL will receive the missed call alerts. Possible values are FIRST, ALL. Defaults to FIRST.NOFIRST
cliDefines a voxnumber to be used as the Caller ID. Alternatively, the $_voxnumber variable can be used. The $_voxnumber variable translates to the voxnumber used to initiate the call.NON/A

Examples

Below are some examples of the XML required to create different call scenarios.

Basic Fixed Call Rule

We will start with a basic one and add more details as we progress through the examples. The following XML will make a simple fixed call to one of the Contacts in our system. It will call the phone number 447723468855 of your Contact with ID 1, no matter which Link you apply this Call Flow to.

<call id="call_1" label="Call" destinationPhoneNumber="447723468855" destinationContactId="1"/>

Another example but this time with destinationContactName. Bear in mind with this example that when you have multiple contacts with the same name, and phone number, the first matched will be the one used. The ordering of this is not guaranteed.

<call id="call_1" label="Call" destinationPhoneNumber="447723468855" destinationContactName="Bob Plumbers"/>

Here you've grasped the basic static Call rule. Let's get a bit more complicated...

Basic Variable Call Rule

The previous examples called the same Contact irrespective of which Link you applied the Call Flow to. If you wish to have the same basic template but change the Contact to use based on the Link, then you can use variable values. You will specify that you wish the Contact to be different on each Link by setting the parameters as ? instead of a value. When you apply the Call Flow to a link you will specify the values to be used to reference the Contact. See the example below:

<call id="call_1" label="Call" destinationPhoneNumber="?" destinationContactId="?"/>

Call Rule with Whisper to the Caller and Called

We can extend the above examples to add a Whisper to the caller and/or called party. For example to play "IOVOX is connecting you" to the caller and play "This Lead is brought to you by IOVOX" to the called party, you will specify the label that references the sound files that belong in your account. The XML for this Rule is as follows:

<call id="call_1" label="Call" destinationPhoneNumber="?" destinationContactId="?">
    <callerMessage>
        <soundFile soundLabel="IOVOX connecting you"/>
    </callerMessage>
    <calledMessage>
        <soundFile soundLabel="Lead brought by IOVOX"/>
    </calledMessage>
</call>

Call Rule with Call Result and Failure

After an outbound call has finished you can check the result of the call and then continue down your call flow based on how the call ended. In the example below we will catch any call that results in BUSY or REJECTED, or ANSWERED. If the call didn't result in either of these then the failure will match the other possibilities - e.g. NO_ANSWER

<call id="call_1" label="Call" record="true" recordingLabel="recordingLabel" recordCallNotificationLabel="defaultRecordMessage" sendCallAlert="NONE" destinationPhoneNumber="?" destinationContactId="?">
    <eventHandlers>
        <callEvent action="onMatchResult" result="REJECTED|BUSY">
            <!-- Rules -->
        </callEvent>
        <callEvent action="onMatchResult" result="ANSWERED">
            <!--- Rules -->
        </callEvent>
        <failure id="failure_1" label="Failure" attempts="3">
            <failureMessage>
                <!-- messageParts -->
            </failureMessage>
            <!-- Rules -->
        </failure>
    </eventHandlers>
</call>

Result

Error Result

HTTP CodeError StringResolution
400Rule ID Empty Set the value of the id attribute
400Rule Label Empty Set the value of the label attribute
400Rule ID Not Unique in Call RuleThe value of the id attribute is used for an other rule, change it to be unique
400Sound File x of y Does not exist in Whisper CallerCorrect the Sound Label or the Sound Group for that file
400Sound File Variable need to be set in Whisper CalledSet the required Sound File for the variable needed
400Sound File x of y Does not exist in Whisper CalledCorrect the Sound Label or the Sound Group for that file
400You need to select a ContactThe contact is not been set in the Call Rule
400Destination Contact Name Variable need to be set in Call RuleThe destination Contact Name has not been set in the Destination Contact Name
400Destination Contad Id Variable need to be set in Call RuleThe destination Contact Id has not been set in the Destination Contact Name
400Destination Contad Phone Number Variable need to be set in Call RuleThe destination Contact Phone has not been set in the Destination Contact Name
400Contact cannot have Variable and Fix details at the same timeThe contact details cannot have variables values and fix values at the same time. Please correct the attributes related to the contact
400Destination Contact does not existThe destination contact does not exist
400Action EmptySet the attribute Action
400Action InvalidThe Action set is not valid in the Call Event
400Result EmptySet the attribute Result
400Duplicate ITEM_1 ReceivedThe Value Result is duplicated in the Call Events
400Event ITEM_1 not valid in Call EventCorrect the result value in the Call Event