Page 1 of 1

Recording a user initiated outbound call/transfer

Posted: Tue May 15, 2012 9:30 am
by desertfoxmb
I’ve gone through the documentation and forums and can’t seem to find the answer I need. Unfortunately, all the terms I would need to use to search the forums are deemed too common and don’t return any results.

We are interested in adding the following workflow to our system:

1) Our user initiates an outbound call to themselves from within our software.
2) The script that the outbound call uses then initiates a transfer to a third party (their client)

We want to provide the option to record the call between our user and the third party. How can this be accomplished with Plum?

Re: Recording a user initiated outbound call/transfer

Posted: Tue May 15, 2012 10:53 am
by admin
Hi Frederick,

You can use the "recordcall" property to record the call between the callee (your user) and the third party. Be sure to place the "recordcall" property within the <form> you do your transfer. Here's some example code:

Code: Select all

<var name="user_phone_num" expr="your user's phone number, or whatever ANI you want to display"/>
<var name="client_phone_num" expr="the third party phone number"/>

<form>
  <block>
    <prompt>You are being transferred.</prompt>
    <assign name="dest_expr" expr="'tel:+1' + client_phone_num + ';ani=' + user_phone_num"/>
    <goto next="#transfer"/>
  </block>
</form>

<form id="transfer">
  <property name="recordcall" value="true"/>

  <transfer name="my_transfer" destexpr="dest_expr">
    <filled>
      <if cond="my_transfer == 'near_end_disconnect'">
	<throw event="nearend"/>
      </if>

      <if cond="my_transfer == 'maxtime_disconnect'">
	<throw event="maxtime"/>
      </if>

      <if cond="my_transfer == 'network_disconnect'">
	<throw event="network"/>
      </if>

      <if cond="my_transfer == 'far_end_disconnect'">
	<throw event="farend"/>
      </if>
    </filled>
  </transfer>

  <catch event="connection.disconnect.hangup nearend maxtime network farend">
    <submit next="save_recording.php" namelist="callrecording" method="post" enctype="multipart/form-data"/>
  </catch>
</form>
Regards,
Plum Support

Re: Recording a user initiated outbound call/transfer

Posted: Tue May 15, 2012 11:06 am
by desertfoxmb
OK, great. So I should be able to have a prompt set a variable based on dtmf before the form that does the transfer to set the recordcall property based on user input to determine whether or not to start the recording. It would be better if that could be done during the transfer but it is my understanding that this isn't possible. If I'm wrong, please let me know.

Re: Recording a user initiated outbound call/transfer

Posted: Wed May 16, 2012 8:40 am
by admin
Hi Frederick,

It is possible. You can set the variable "dest_expr" inside the same <form> as your transfer. Just make sure you set the variable before the <transfer> tag.

Regards,
Plum Support