Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Mar 28, 2024 5:20 pm
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: single username, password for web and sip/iax accounts
PostPosted: Wed Mar 17, 2010 6:06 pm 
Offline

Joined: Sun Jan 21, 2007 1:33 am
Posts: 22
Is there a way to make single username and password (secret) to login to web, sip and iax registration. Its hard to remember multiple login and passwords. Does anyone achieved this??


Last edited by thameema on Thu Mar 18, 2010 10:58 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: single username, password for web and sip/iax accounts -SOLN
PostPosted: Thu Mar 18, 2010 10:41 pm 
Offline

Joined: Sun Jan 21, 2007 1:33 am
Posts: 22
Since no one replied.. i found out my own solution. I wrote 3 triggers to update the cc_sip_buddies table and enabled the realtime.

Trigger 1:
Code:
DELIMITER $$

USE `asterisk_a2b`$$

DROP TRIGGER /*!50032 IF EXISTS */ `trigg_insert_sip_credentials`$$

CREATE
    /*!50017 DEFINER = 'root'@'localhost' */
    TRIGGER `trigg_insert_sip_credentials` AFTER INSERT ON `cc_card`
    FOR EACH ROW BEGIN
   SELECT uipass INTO @uip FROM cc_card WHERE id = new.id;
    SELECT useralias INTO @ualias FROM cc_card WHERE id = new.id;
    SET @id = new.id;
    UPDATE cc_sip_buddies SET NAME=@ualias, regexten=@ualias, secret=@uip, username=@ualias WHERE id_cc_card = @id;   
    END;
$$

DELIMITER ;


Trigger 2:
Code:
DELIMITER $$

USE `asterisk_a2b`$$

DROP TRIGGER /*!50032 IF EXISTS */ `trigg_upd_sip_credentials`$$

CREATE
    /*!50017 DEFINER = 'root'@'localhost' */
    TRIGGER `trigg_upd_sip_credentials` AFTER UPDATE ON `cc_card`
    FOR EACH ROW BEGIN   
    SELECT uipass INTO @uip FROM cc_card WHERE id = new.id;
    SELECT useralias INTO @ualias FROM cc_card WHERE id = new.id;
    SET @id = new.id;
    UPDATE cc_sip_buddies SET NAME=@ualias, regexten=@ualias, secret=@uip, username=@ualias WHERE id_cc_card = @id;   
END;
$$

DELIMITER ;


Trigger 3:
Code:
DELIMITER $$

USE `asterisk_a2b`$$

DROP TRIGGER /*!50032 IF EXISTS */ `trigg_insert_sip_cred_2`$$

CREATE
    /*!50017 DEFINER = 'root'@'localhost' */
    TRIGGER `trigg_insert_sip_cred_2` BEFORE INSERT ON `cc_sip_buddies`
    FOR EACH ROW BEGIN
    SET @id = new.id_cc_card;
    SELECT uipass INTO @uip FROM cc_card WHERE id = @id;
    SELECT useralias INTO @ualias FROM cc_card WHERE id = @id;   
    SET NEW.name=@ualias;
    SET NEW.username=@ualias;
    SET NEW.secret=@uip;
    SET NEW.regexten=@ualias;
    END;
$$

DELIMITER ;


To link the SIP/IAX to the card, I enabled the linking from "Account Code" instead of Username. Here is the modification to the code,

Code:
In file, /admin/Public/form_data/FG_var_friend.inc (change the line 63 of 986)

$HD_Form -> AddViewElement(gettext("ACCOUNTCODE"), "accountcode", "12%", "center", "sort","", "30", "", "", "", "","linktocustomer");



MODERATORS: Please move this post from "Request" to "General" Section. I am sure lot of people may need this functionality as other billing systems do this.

Thanks
Thameem


Top
 Profile  
 
 Post subject: Re: single username, password for web and sip/iax accounts
PostPosted: Sun Mar 21, 2010 10:43 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Hello Thameem

Your code seems to work, but I think that you have different credentials for security reasons. And I am not entirely sure if sip and iax username and passwords can be used to log in on the customer interface. It is that card web username or e-mail and password that are used for that.

Cheers


Top
 Profile  
 
 Post subject: Re: single username, password for web and sip/iax accounts
PostPosted: Wed Dec 26, 2012 6:09 am 
Offline

Joined: Thu Apr 21, 2011 5:22 pm
Posts: 106
So the only reason we have different username password for customer UI sign in and for sip login is for security? I think there is a saying that, a chain is only as strong as it's weakest link. If one of both is weak, a hacker will get access to the stronger anyways.

Is my analogy correct?


Top
 Profile  
 
 Post subject: Re: single username, password for web and sip/iax accounts
PostPosted: Wed Jul 24, 2013 3:14 pm 
Offline
User avatar

Joined: Fri Sep 18, 2009 5:46 pm
Posts: 132
Location: hhhhmmmmm
sanjap, i agree with you, and thanks for sharing your finding with forum.

sanjap wrote:
So the only reason we have different username password for customer UI sign in and for sip login is for security? I think there is a saying that, a chain is only as strong as it's weakest link. If one of both is weak, a hacker will get access to the stronger anyways.

Is my analogy correct?


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


All times are UTC


Who is online

Users browsing this forum: No registered users and 11 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group