Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Sun Feb 17, 2019 3:41 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to reserve DID by the customer
PostPosted: Tue May 01, 2007 7:22 pm 
Offline

Joined: Tue May 01, 2007 7:15 pm
Posts: 2
Hi all

Im trying to allow DID to be viewed and reserved or allow a "buy" from to take place

If I place the customer in a DID group they can see all DID in that group

And can allocate a destination to the DID even if they are in use by another account.

I might be wrong .. but surly only available DID should allow a "BUY" on it.

HELP

Smudge


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 7:52 am 
Offline

Joined: Tue May 01, 2007 7:15 pm
Posts: 2
Just to close a question down

I found in the a section around line 148

which mentions making changes to none mysql 4 server queries I commented out the query for <4 and all works .. active DID now nolonger show in the "BUY" me form.

Liversmudge
:D

<uncomment this section>
// LIST FREE DID TO ADD PHONENUMBER
$instance_table_did = new Table("cc_did", "id, did, fixrate");
$FG_TABLE_CLAUSE = "id_cc_country=$choose_country and id_cc_didgroup='".$_SESSION["id_didgroup"]."' and activated='1
' and id NOT IN (select id_cc_did from cc_did_destination)";


<comment out this section>
// FIX SQL for Mysql < 4 that doesn't support subqueries
//$instance_table_did = new Table("cc_did LEFT JOIN cc_did_destination ON cc_did.id!=cc_did_destination.id", "DISTIN
CT cc_did.id, did, fixrate");
//$FG_TABLE_CLAUSE = " id_cc_country=$choose_country and id_cc_didgroup='".$_SESSION["id_didgroup"]."' and cc_did.ac
tivated='1'";





Top
 Profile  
 
 Post subject: DID selling bug User GUI
PostPosted: Mon May 07, 2007 12:14 pm 
Offline
User avatar

Joined: Sun Apr 29, 2007 4:08 am
Posts: 14
That code can't work ....perfectlly...because it update all when anyone add a new number to same country DID and It can't work the Priority feature.
I use PostgresSQL
So I resend the code....
If it has any error or bug then post the ack so that i can post the perfect one.



if (strlen($destination)>0 && is_numeric($choose_did) && is_numeric($voip_call)){

$FG_DID_TABLE = "cc_did";
$FG_DID_FIELDS = "did";
$instance_sub_table = new Table($FG_DID_TABLE, $FG_DID_FIELDS);

$QUERY = "SELECT * FROM cc_did_destination where id_cc_did = ".$choose_did;
$result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY);




if( $result[0][4]==$choose_did)
{


$instance_sub_table_P = new Table("cc_did_destination", "priority");
$QUERY_P = "SELECT MAX(priority) FROM cc_did_destination where id_cc_did = ".$choose_did;
$result_P = $instance_sub_table_P -> SQLExec ($HD_Form -> DBHandle, $QUERY_P);
$Set_Priority=$result_P[0][0] + 1;

$QUERY = "INSERT INTO cc_did_destination (activated, id_cc_card, id_cc_did, destination, priority, voip_call) VALUES ('1', '".$_SESSION["card_id"]."', '".$choose_did."', '".$destination."', '".$Set_Priority."', '".$voip_call."')";
$DID_UID_QUERY .= "UPDATE cc_did SET iduser='".$_SESSION["card_id"]."' WHERE id='".$choose_did."'";


}
else
{ $QUERY = "INSERT INTO cc_did_destination (activated, id_cc_card, id_cc_did, destination, priority, voip_call) VALUES ('1', '".$_SESSION["card_id"]."', '".$choose_did."', '".$destination."', '1', '".$voip_call."')";
$DID_UID_QUERY .= "UPDATE cc_did SET iduser='".$_SESSION["card_id"]."' WHERE id='".$choose_did."'";

}

$result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 0);
$DID_UID_result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $DID_UID_QUERY, 0);

//$QUERY = "INSERT INTO cc_did_destination (activated, id_cc_card, id_cc_did, destination, priority, voip_call) VALUES ('0', '".$_SESSION["card_id"]."', '".$choose_did."', '".$destination."', '1', '".$voip_call."')";
//$result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 0);


$date = date("D M j G:i:s T Y", time());
$message = "\n\n".gettext("The following Destinaton-DID has been added:")."\n\n";
$message .= "$QUERY";

// email header
$em_headers = "From: IPS ALERT <[email protected]>\n";
$em_headers .= "X-Priority: 3\n";

if (strlen($A2B->config["webcustomerui"]['error_email'])>3)
mail($A2B->config["webcustomerui"]['error_email'], "[$date] Destinaton-DID notification", $message, $em_headers);


}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group