function smshub_custom1 ($msg, $mobile, $flash, $sender, $username, $password, $account, $url, $proxy, &$error) {
// load WSDL file for Custom1 SOAP SMSC
$wsdl = "smshub.wsdl";
if (!file_exists($wsdl)) {
$error = "WSDL file '$wsdl' does not exists";
return false;
}
// set HTTP proxy connection
$options = array('exceptions' => false);
if ($url != NULL) $options['location'] = $url;
if ($proxy) {
$options['proxy_host'] = $proxy['host'];
$options['proxy_port'] = $proxy['port'];
if ($proxy['user']) $options['proxy_login'] = $proxy['user'];
if ($proxy['password']) $options['proxy_password'] = $proxy['password'];
}
// create SOAP client
$client = new SoapClient($wsdl, $options);
if (!$client) {
$error = "Could not load WSDL file '$wsdl'";
return false;
}
// set soap request
$req = array("mobile"=>$mobile, "text"=>$msg,"username"=>$username,"password"=>$password, "sender"=>"NK_Bank", "flash"=>$flash);
// send soap request
$ret = $client->__soapcall("sendmsg", $req);
if (!$ret) {
$error = "Invalid SOAP response";
return false;
}
if (is_soap_fault($ret)) {
$error = $ret->faultstring;
return false;
}
// Check soap response and return
// -> true on success