Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 3:13 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: SIP-IAX accounts created BEFORE activation
PostPosted: Tue Dec 11, 2007 2:21 am 
Offline

Joined: Tue Nov 07, 2006 8:25 pm
Posts: 23
Hello,

Actually, the SIP-IAX accounts are created BEFORE the user activated his account.
At this stage, we're not sure if email is valid, and if user will ever activate + login + pay to use his service.

This leads to false and messy customer list and an unecessary use of space (MYSQL, asterisk conf file) and CPU.
And if you've chosen 'asterisk reload' and 'remove the captcha' ... you can fear a 'serial register' making false registration leading to an overload of your server and stoping your actual customers! (asterisk non stop reload + MySQL buddies tables filling + conf file writing + web access).

And the only way to remove all these false customers + SIP-IAX buddies will be ONE by ONE from UI (or phpmyadmin)!
(That's a request: to be able to tick customers in the list and delete them in one click)

SIP IAX accounts (and asterisk reload) should be created after activation.
(being called by 'activate'??)

And if someone can explain me the signup process, especially within these files:
FG_var_index.inc
Class.FormHandler.inc.php
Class.FormHandler. ... .inc.php
:roll: I'll be happy!
and if I understand the whole process, I can give a hand to fix it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 11, 2007 1:04 pm 
Offline

Joined: Tue Nov 07, 2006 8:25 pm
Posts: 23
anyone??


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 11, 2007 5:11 pm 
Offline

Joined: Tue Nov 07, 2006 8:25 pm
Posts: 23
in FG_var_index.inc:
Code:
if(RELOAD_ASTERISK_IF_SIPIAX_CREATED) {
   $HD_Form -> FG_ADDITIONAL_FUNCTION_AFTER_ADD = 'create_sipiax_friends_reload';
} else {
   $HD_Form -> FG_ADDITIONAL_FUNCTION_AFTER_ADD = 'create_sipiax_friends';
}


in Class.FormHandler,inc:
Code:
         // CALL DEFINED FUNCTION AFTER THE ACTION ADDITION
         if (strlen($this->FG_ADDITIONAL_FUNCTION_AFTER_ADD)>0)
                  $res_funct = call_user_func(array(&$this, $this->FG_ADDITIONAL_FUNCTION_AFTER_ADD));


To execute it at activation, do we need to gather data from database (query) and rewrite the function or an easier way??


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 12, 2007 2:08 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
canadian wrote:
To execute it at activation, do we need to gather data from database (query) and rewrite the function or an easier way??
It's a good suggestion to delay creation of the SIP/IAX peers until after activation, and I think you're on the right track there. I can't see there being an easier way, but perhaps someone more familiar with the code has a cunning suggestion.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 12, 2007 1:10 pm 
Offline

Joined: Tue Nov 07, 2006 8:25 pm
Posts: 23
Thanks Steve,
I understand there might be more urgent and technical bugs. BTW, IMHO, this one can cost your business if one doesn't pay attention.

Calling
Code:
$HD_Form -> create_sipiax_friends()

from activate produces nothing and no log available.

What do we need to include-set-query-call, to use the create_sipiax_friends function??
How to add log debug to FormHandler?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 12, 2007 9:35 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
OK I've actually read the code involved now and I think perhaps there's a easier way to solve this. Set sip_account and iax_account=no in a2billing.conf so no peers are created during signup, and modify activate.php to set these fields to yes and call create_sipiax_friends() from there.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 13, 2007 8:04 pm 
Offline

Joined: Tue Nov 07, 2006 8:25 pm
Posts: 23
Umm,
It was a good idea, but it's not working, at least for me.
Did you try it succesfully??

I think (may be I'm wrong): since you went out of the form (you come from an email link), all variables are reset, making the function not function as is.
We need to reconstruct variables from query with the key and add condition in the function ('if coming from activate').

But I don't know which variables and how to do it :cry:

Not sure if it's clear, english is a second language so far.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 14, 2007 12:15 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I understand you just fine.
I didn't try this yet, no. I'm very busy currently.

At activation time we know the loginkey, and it's already being used to update the cc_card table. All we need to do is additionally set the flags to create SIP/IAX peers for this user, then call the function to write the SIP/IAX configurations and reload Asterisk. Find the code around line 45 of A2Billing_UI/Signup/activate.php that reads:
Code:
    $QUERY = "UPDATE cc_card SET  activatedbyuser = 't' WHERE ( loginkey = '".$key."' ) ";
    $result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 0);
and change it to
Code:
    $QUERY = "UPDATE cc_card SET  activatedbyuser = 't', sip_buddy='1', iax_buddy='1' WHERE ( loginkey = '".$key."' ) ";
    $result = $instance_sub_table -> SQLExec ($HD_Form -> DBHandle, $QUERY, 0);
    create_sipiax_friends_reload();
I've not tested this, so perhaps the Signup interface doesn't have the correct permissions for create_sipiax_friends_reload() to work correctly.


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


All times are UTC


Who is online

Users browsing this forum: No registered users and 10 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