We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How to use credit and call transfer?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
test.suffescom
Posts: 5
Joined: Tue Sep 29, 2015 4:12 am

How to use credit and call transfer?

Post by test.suffescom »

Hello,

Requirements:

The IVR system will also need to be attached to the customers billing/credit card section. The way that the IVR wil work is that it will give a limit of 4 minutes per call and if the user goes over the allowed time then they will billed per minute.
When customer calls the IVR system the system will ask them to input the tag ID number, found on the tag, then the system dials all 5 numbers at the same time until the first person picks up the phone.

When user enter tag id then, i have to retrieve 5 contact number form database from corresponding tag id, then transfer call until the first person picks up the phone.

My code:

test.php

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form>
<field name="tagid" type="digits">
<prompt>
Welcome To my Petcode.
Please enter tag id found on pet collar using your keypad.
</prompt>
<filled>
<assign name="tagid" expr="tagid"/>
<prompt>
You entered <value expr="tagid"/>.
</prompt>
<!-- transfer to premium support -->
</filled>
<noinput>
<prompt>
Sorry, I didn't hear you.
</prompt>
<reprompt/>
</noinput>
</field>

<block>
<prompt>
Please wait while we process your information.
</prompt>
<submit namelist="tagid" next="http://example.com/vxml/submit.php"/>
</block>
</form>
</vxml>
submit.php

Code: Select all

?php
include('../wp-load.php');
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$tagid = trim($_GET[tagid]);
global $wpdb;
$customer_petinfo_table_name = $wpdb->prefix . 'XXXXXXX';
$getpetinfo = $wpdb->get_results( "SELECT ownerUserid FROM " . $customer_petinfo_table_name . " where petTagid = ".$tagid." " );
if(count($getpetinfo)){
foreach($getpetinfo as $pet){
$user_id = $pet->ownerUserid;
}
}
$contact1 = get_user_meta($user_id, 'contact1', true);
$contact2 = get_user_meta($user_id, 'contact2', true);
$contact3 = get_user_meta($user_id, 'contact3', true);
$contact4 = get_user_meta($user_id, 'contact4', true);
$contact5 = get_user_meta($user_id, 'contact5', true);
?>

<vxml version="2.0">
<form>
<block>
<prompt>
Your tag id number is <?php echo($tagid); ?>
</prompt>
</block>
<!-- transfer to customer service representative -->
<transfer dest="<?php echo $contact1;  ?>" connecttimeout="20s" bridge="true"/>
</form>
</vxml>

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to use credit and call transfer?

Post by support »

Hi,

It is not possible to initiate 5 call transfers within a single call at the same time.

You will have to attempt to transfer to each of the numbers one by one until a representative picks up. A more elegant solution would be to transfer to a PBX at your call center that can balance calls based on availability.

Regards,
Plum Support

Mypetcode
Posts: 2
Joined: Wed Sep 30, 2015 7:29 pm

Re: How to use credit and call transfer?

Post by Mypetcode »

Hi,

Here is a more detailed explanation of how the phone system worked with previous IVR provider. I ran this by one of your representatives and he did say that the system was capable of completing this process so there may be a miscommunication here. Here is the explanation:

I sell a pet collar tag that offers customers a digital form of pet retrieval. A pet owner purchases a tag, creates an account and then fills their personal and pet profiles. The pet owner can then enter up to 5 phone numbers for their closest contacts. When a pet becomes lost and is found by a rescuer the rescuer can then call a toll free number, provided by a 3rd party. This toll free number forwards the rescuer to the IVR system. The recording on the IVR system then directs the rescuer to enter a 5 digit ID number, the system will then dial all 5 numbers, found in the pet Profile, simultaneously until a contact answers the line. Once they are connected they have 4 minutes to discuss further details, after 4 minutes they will be charged a per minute rate.

My developer has been having troubles with getting the system to make the 5 simultaneous calls and also to get the per minute billing active.

I look forward to hearing back.

Thank you

Mypetcode
Posts: 2
Joined: Wed Sep 30, 2015 7:29 pm

Re: How to use credit and call transfer?

Post by Mypetcode »

Hi,

I believe that there may be a miscommunication in the details as I was told by a Plum representative that the IVR system was capable of making the 5 simultaneous calls. Here is a more descriptive explanation of how the system worked on the previous IVR system, hopefully it can help clarify any issues or miscommunications I may have had with the representative.

I sell a Pet collar tag that offers pet owners a digital form of pet retrieval. When a pet owner purchases a tag they will then create an account and fill out their personal and pet profile. On the personal profile they will have the option to add 5 phone numbers of their closest contacts. If their pet becomes lost and is subsequently rescued a rescuer has the option to call a toll free number, provided by a 3rd party, which is found on the tag. This toll free number then forwards the call to the IVR system, once connected to the IVR a recording prompts the rescuer to enter the 5 digit ID number, found on the tag. This will then trigger the system to access the 5 numbers found on the pet owners profile. The system will then dial these numbers simultaneously until the call is answered. Once the call has been answered the pet owner will have 4 minutes to discuss, with the rescuer, the details of the rescue. If the call exceeds the 4 minutes then a voice notification will let the pet owner know that their credit card attached to their profile will now be billed per minute.

My developer, test.suffescom, is having issue developing the portion that will connect the 5 numbers in the profile to the IVR system and is also having issues developing the portion that sets the time limit and then bills the pet owners credit card.

Thank you for your time with this matter and I hope that you have a solution for our issue at hand, I look forward to hearing from you.

test.suffescom
Posts: 5
Joined: Tue Sep 29, 2015 4:12 am

Re: How to use credit and call transfer?

Post by test.suffescom »

Ok,But how i will manage credit when some body picks phone,then after 4 minutes user billed per minute.?

And for transfer call to each of the numbers one by one until a representative picks up.

Please check my code :

Code: Select all

?php
include('../wp-load.php');
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$tagid = trim($_GET[tagid]);
global $wpdb;
$customer_petinfo_table_name = $wpdb->prefix . 'XXXXXXX';
$getpetinfo = $wpdb->get_results( "SELECT ownerUserid FROM " . $customer_petinfo_table_name . " where petTagid = ".$tagid." " );
if(count($getpetinfo)){
foreach($getpetinfo as $pet){
$user_id = $pet->ownerUserid;
}
}
$contact1 = get_user_meta($user_id, 'contact1', true);
$contact2 = get_user_meta($user_id, 'contact2', true);
$contact3 = get_user_meta($user_id, 'contact3', true);
$contact4 = get_user_meta($user_id, 'contact4', true);
$contact5 = get_user_meta($user_id, 'contact5', true);
?>

<vxml version="2.0">
<form>
<block>
<prompt>
Your tag id number is <?php echo($tagid); ?>
</prompt>
</block>
<!-- transfer to customer service representative -->
<transfer dest="<?php echo $contact1;  ?>" connecttimeout="20s" bridge="true"/>
<transfer dest="<?php echo $contact2;  ?>" connecttimeout="20s" bridge="true"/>
<transfer dest="<?php echo $contact3;  ?>" connecttimeout="20s" bridge="true"/>
<transfer dest="<?php echo $contact4;  ?>" connecttimeout="20s" bridge="true"/>
<transfer dest="<?php echo $contact5;  ?>" connecttimeout="20s" bridge="true"/>
</form>
</vxml>

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to use credit and call transfer?

Post by support »

Hi,

We are sorry to say we do not support simultaneous transfers. What the representative might have meant was that you are able to place 5 simultaneous outbound calls.

You may be able to use outbound calling to achieve a solution similar to what you are looking for. When the caller calls into the IVR and enters a tag number, you can launch an outbound campaign to the five numbers associated. When one of the pet owners picks up, he can confirm that he wants to accept the call from the caller and hangs up the call. This outbound script sets a flag in your infrastructure indicating that a callee is ready. Meanwhile, the caller is waiting on the IVR, which will continually attempt to fetch a script in your infrastructure which will let the IVR know when a callee is ready. When a callee is ready, the IVR will use the information from the script to attempt the transfer to the callee.

Documentation on outbound calling can be found here: http://www.plumvoice.com/docs/dev/plumd ... boundguide

We do not support the playing of voice notifications in the middle of a transfer. We suggest notifying the callee ahead of time that the billing information on file will be charged for any excess minutes.

You can use the name$.duration shadow variable to help calculate the excess minutes during a transfer. Information about it can be found in our documentation for the <transfer> tag. On that page, you will also find information about how set and use conditions to determine whether you should attempt the next transfer on the IVR.

Regards,
Plum Support

test.suffescom
Posts: 5
Joined: Tue Sep 29, 2015 4:12 am

Re: How to use credit and call transfer?

Post by test.suffescom »

Can you explain,Why in my account underneath "Developer Tools" , no option for "Outbond Calling"?


Can you also review my code,I am going right?

test.php

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form>
  <field name="tagid" type="digits">
      <prompt>
	  Welcome To my Petcode.
        Please enter tag id found on pet collar using your keypad.
      </prompt>
	  <filled>
        <assign name="tagid" expr="tagid"/>
        <prompt>
          You entered <value expr="tagid"/>.
        </prompt>
        <!-- transfer to premium support -->
      </filled>
	  <noinput>
        <prompt>
          Sorry, I didn't hear you.
        </prompt>
        <reprompt/>
      </noinput>
  </field>


  <block>
    <prompt>
      Please wait while we process your information.
    </prompt>
    <submit method="post" enctype="multipart/form-data" namelist="tagid" next="http://demo.ex.com/vxml/outboundcampaign.php"/>
  </block>
</form>
</vxml>
outboundcampaign.php

Code: Select all


<?php

$params['login'] = "user2";
$params['pin'] = "88888888";
$params['campaign_name'] = "callnumbers";
$params['phone_list'] = "@path/to/file/phonenumbers.txt";
$params['start_url'] = "http://www.mywebserver.com/~user/myscript.php";

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, "http://outbound.plumvoice.com/webservice/queuecalls.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);


$result = curl_exec($ch);
echo $result;

curl_close($ch);

?>
Can You also explain about [start_url] parameter and myscript.php ?


Please reply as soon as possible.

Thanks

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to use credit and call transfer?

Post by support »

Hi,

It seems like outbound calling is currently not enabled on your account. Please talk to your account manager about enabling this feature.

The start_url parameter is the URL for the vxml code you want to use for your outbound calls. When an outbound call is connected, the IVR will fetch and start the VXML script from the URL you provided in that parameter.

You should replace the "myscript.php" url to the url of the script you wish to use.

Regards,
Plum Support

test.suffescom
Posts: 5
Joined: Tue Sep 29, 2015 4:12 am

Re: How to use credit and call transfer?

Post by test.suffescom »

Hello,

I have some problem to test outbond call.

Can please help me to find out issue or guide me.

I am trying to create a single outbound call for testing purpose.
I am not able to connect call but in my account showing call status "Completed".

This is my script:

test.php for start_url:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form>
  <field name="tagid" type="digits">
      <prompt>
	  Welcome To my Petcode.
        Please enter tag id found on pet collar using your keypad.
      </prompt>
	  <filled>
        <assign name="tagid" expr="tagid"/>
        <prompt>
          You entered <value expr="tagid"/>.
        </prompt>
        <!-- transfer to premium support -->
      </filled>
	  <noinput>
        <prompt>
          Sorry, I didn't hear you.
        </prompt>
        <reprompt/>
      </noinput>
  </field>


  <block>
    <prompt>
      Please wait while we process your information.
    </prompt>
    <submit method="post" enctype="multipart/form-data" namelist="tagid" next="http://xxx.com/petdev/vxml/outboundcampaign.php"/>
  </block>
</form>
</vxml>
outboundcampaign.php

Code: Select all

$params['login'] = "xxxx";
$params['pin'] = "xxx";
$params['campaign_name'] = "newcamp";
$params['phone_number'] = "tel:+xxxx";
$params['message_reference'] = 'Hello';
$params['start_url'] = "http://xxxx.com/petdev/vxml/test.php";

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, "http://outbound.plumvoice.com/webservice/queuecall.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);


$result = curl_exec($ch);
echo $result;

curl_close($ch);
Also this is right way to do that?

Thanks,

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to use credit and call transfer?

Post by support »

Hi,

The "completed" status means that a call was attempted and that someone or something picked up at the end of the line. The callee_type will give you an idea of whether a person or answering machine picked up the phone.

We recommend that you double check the number and try calling into the number directly to diagnose the issue.

Regards,
Plum Support

Post Reply