Table of Contents

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

Go to Advanced/Announcements page , and click “ADD” button to add a main ivr flow.

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.

first action need to answer the call.

second, add a readdata action(play a announcment and receive customer enter)

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.

add sub flow for replay and confirm customer id

add sub flow for call the webservice

Add the DID number

Go to PBX/DID page , and click “ADD” button

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.

php webservice sample

checkcustomer.php and checkcustomer.wsdl 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

if your custom page is using our framework, you can read Embed System under Same Domain if not , you can get from http push event how to use http_push sampl page to receive system events