====== Call webservice in IVR======
Use result return by webservice for IVR transfer
We will instruct a business members service IVR flows, and will call a webserivce for checking the card number which customer enter from IVR.
===== Create the IVR flows =====
* upload the announcement voices
Go to Advanced/Announcements page , and click "ADD" button to add a main ivr flow.
{{:en:use_case:add_announce_1.png?600|}}
{{:en:use_case:add_announce_2.png?600|}}
{{:en:use_case:add_announce_3.png?600|}}
* create IVR
Go to Advanced/IVR page , and click "ADD" button to add a main ivr flow.
add a main flow, max loop times set to 3.
{{:en:use_case:ivr_1.png?600|}}
first action need to answer the call.
{{:en:use_case:main_aciton_1.png?600|}}
second, add a readdata action(play a announcment and receive customer enter)
{{:en:use_case:main_action2.png?600|}}
set the transfer condition, if caller have no customerid , the annoucement tell him enter the '#', else enter his customer id,
so if ivr reiceived '#', we transfer the call to the queue named "Other", if reiceived the 'customer id', then transfer a sub flow that
let customer confirm them entered customer id.
{{:en:use_case:main_transfer.png?600|}}
add sub flow for replay and confirm customer id
{{:en:use_case:p_ivr_1.png?600|}}
{{:en:use_case:p_action_1.png?600|}}
{{:en:use_case:p_action_2.png?600|}}
{{:en:use_case:p_action_3.png?600|}}
{{:en:use_case:p_ivr_transfer.png?600|}}
add sub flow for call the webservice
{{:en:use_case:c_ivr_1.png?600|}}
{{:en:use_case:c_action_1.png?600|}}
{{:en:use_case:c_ivr_transfer.png?600|}}
===== Add the DID number=====
* add a special incoming DID number
Go to PBX/DID page , and click "ADD" button
{{:en:use_case:add_did.png?600|}}
===== Create inbound route =====
go to Advanced/Inbound routes page, and click the "Add" button
select the special DID, and choose the main ivr from transfer.
{{:en:use_case:add_iroute.png?600|}}
===== php webservice sample =====
checkcustomer.php and checkcustomer.wsdl
{{:en:use_case:webservice_sample_php.zip|}}
function checkcustomerid($callerid,$customerid)
{
#$dbCon = $this->dbConnect();
if(empty($customerid)){# customerid is empty
return 'Failure|'.$customerid."|TESTSTR";
}
#$sql = "SELECT * FROM customers WHERE id = '$customerid'";
#$ref = mysql_query($sql) or die('-9');
#$res = mysql_fetch_array($ref);
if($customerid == '123456'){ # found the customer by customerid
return "Enterprise|".$customerid."|TESTSTR";
}elseif($customerid == '789'){
return "SMB|".$customerid."|TESTSTR"; # cant found the customer by customerid
}else{
return "Other|".$customerid."|TESTSTR";
}
}
===== get customer enter form astercc event=====
{{:en:use_case:vartoagent.png?600|}}
if your custom page is using our framework, you can read [[en:custom_development_guide:how_to_integrate_custom_page_in_astercc|Embed System under Same Domain]]
if not , you can get from http push event [[en:custom_development_guide:how_to_use_http_push_sample_page_to_receive_system_events|how to use http_push sampl page to receive system events]]