Summary:ASTERISK-02747: [PATCH] added support for pins to astcc.
Reporter:Darren Wiebe (darren)Labels:
Date Opened:2004-11-05 23:46:58.000-0600Date Closed:2005-05-15 01:47:59
Versions:Frequency of
Environment:Attachments:( 0) astcc_users.cgi-Tariff.patch
( 1) astcc.agi-TARIFF.patch
( 2) astcc-accountnum2.gsm
( 3) astcc-admin.cgi-Tariff.patch
( 4) astcc-invalidpin.GSM
( 5) astcc-patch.txt
( 6) astcc-pin.GSM
( 7) astcc-pleasepin.GSM
Description:I have added support for pins to be attached to calling cards.  I have included a few new .gsm files.  I'm not very happy with the voice quality as my voice is not really designed for this but....  I have also changed it so that it asks for the correct length of card numbers, depending on the program setup.

I do have a disclaimer on file
Comments:By: Darren Wiebe (darren) 2004-11-08 09:55:56.000-0600

I have another very small patch that fixes the Local channel support.  It was not properly calculating call costs done on Local.

By: twisted (twisted) 2004-11-08 09:57:12.000-0600

Last I checked, if you have a zero-cost call (ie, tollfree numbers sometimes should be setup as 0 cost, 0 connect charge), we die, since we try to divide by zero.  I'll take another look at it sometime soon and get a patch, unless you'd like to take a look.

By: Darren Wiebe (darren) 2004-11-13 18:37:27.000-0600

I'll try to get a patch unless you have one already.

By: Brian West (bkw918) 2004-11-30 00:10:17.000-0600


By: Darren Wiebe (darren) 2004-12-02 20:38:12.000-0600

I'm sorry this is taking me so long.  If twisted would be interested in doing the patch he is more than welcome.

By: Darren Wiebe (darren) 2004-12-07 22:27:47.000-0600

I added a few eval statements to it.  It seems to be working now.  I would appreciate if somebody would try it out also...  My connection is poor to say the least at present.

By: Olle Johansson (oej) 2004-12-19 07:54:08.000-0600

Any testresults? We need to move this patch forward or close.


By: Darren Wiebe (darren) 2004-12-19 21:31:36.000-0600

I believe that there are several (at least) people using these patches with no ill effects.

By: Darren Wiebe (darren) 2004-12-20 23:14:19.000-0600

I just heard from a user who is successfully using these patches.

By: Darren Wiebe (darren) 2004-12-29 13:32:29.000-0600

I just uploaded a couple of minor fixes I received from a user.

By: Mark Spencer (markster) 2005-01-06 23:57:02.000-0600

Great we just need the prompts recorded by allison for this!

By: Mark Spencer (markster) 2005-01-16 01:45:54.000-0600

We need prompts for this to move anywhere, an luck in getting someone to do them?

By: Darren Wiebe (darren) 2005-01-16 08:32:18.000-0600

Yes, I'm surprised I don't have them yet.  Sometime around the 12th, they were to have been submitted to "the voice".  On Monday, I'll confirm that is what happened.

edited on: 01-16-05 08:49

By: Mark Spencer (markster) 2005-01-28 21:46:50.000-0600

Any luck with the prompts?

By: Mark Spencer (markster) 2005-02-04 01:20:24.000-0600

Any luck with those prompts?  Are they still pending, if so let me know so I can look into it.  Usually they only take a few days to get processed.

By: Darren Wiebe (darren) 2005-02-16 21:15:18.000-0600

I finally got one of them.  I just submitted another one that got missed.  It should only take a day or two now.  Sorry this has dragged on so long

By: Mark Spencer (markster) 2005-03-01 00:34:29.000-0600

No worries, just let me know when it's ready.  Thanks!

By: karlp (karlp) 2005-03-03 09:21:09.000-0600

Has the Makefile been updated yet so that the sound files go to /var/lib/asterisk/sounds rather than /usr/share/asterisk/sounds?

Also there is still the division by 0 issue in the line:
$maxmins = int(($credit - $adjconn) / $adjcost);

I have changed it locally to:

if ($adjcost < 1) {
$maxmins = $credit;
} else {
$maxmins = int(($credit - $adjconn) / $adjcost);

but the selection of maxmins is arbitrary.  I would be happy to submit the change as a patch but any alternative suggestions to what maxmins should be set to would be welcomed.

By: Darren Wiebe (darren) 2005-03-03 19:03:01.000-0600

I have the sound files ready to upload.  Finally.... :-(  However, I get an error message when I try to send them:


File upload failed. PHP file uploads may be disabled. Please ask your admin to run the admin_check script to debug this problem.

By: Darren Wiebe (darren) 2005-03-05 10:20:32.000-0600

Finally, months late, I have uploaded audio files from Alison.  I'm going to get a better copy of the invalid-pin one but I would appreciate if you would not wait on that.....

By: Brian West (bkw918) 2005-03-17 21:19:33.000-0600

SADDLE UP AND RIDE... where is mark?


By: Mark Spencer (markster) 2005-03-19 21:03:42.000-0600

Which patch am I supposed to apply?

By: Darren Wiebe (darren) 2005-03-21 23:22:05.000-0600

I just looked through them all.  Can you do all of them in the order they were uploaded?  The later ones build on the first one.  If this is a problem, I will download them myself and make a new patch.

By: Michael Jerris (mikej) 2005-03-22 05:56:12.000-0600

Please create a single diff -u patch against current head.

By: () 2005-04-09 05:43:31

I have uploaded three patches to astcc.agi, astcc-users.cgi and astcc-admin.cgi to  be able to use an aditional parameter (tariff). This parameter will decide which copy of the table "routes" will be used.
Two minor buggs are also corrected (division by zero, if the call cost "nothing") and for the trunk "local" the correct spelling so that you can reach the contest in your extensions.conf.
You need to make a copy of the table routes via phpMysql and change the values you need to change.

To do:
1. Add a selection for the tariffs in astcc-admin.cgi
2. change the date displayed to a sortable value (2005-03-23 14:44:23)
3. change sort order to display the last calls on top
4. change to select a date/time frame of the records
5. change the caller-id to the comment field of the tariff (called country)
and make the caller-id just as a head line.

By: Michael Jerris (mikej) 2005-04-17 22:50:53

Reminder sent to darren, Ronald

What is the status on this.  Is this two different issues.  Is there a single patch on here that is ready to go in?  Are there some files that can be deleted off this bug for clarity?

By: () 2005-04-18 02:33:42


you can use or not use the patch, ... it is simple up to you.

By: Michael Jerris (mikej) 2005-04-18 08:17:08

My question is, what patches are necessary for this ticket, and are they ready to go in to head?

By: Darren Wiebe (darren) 2005-04-19 18:30:36

I have uploaded a unified patch for everything except the last 3 patches.  Therefore, presuming Ronalds stuff is going on another bug report, the only necessary patch is the newpatch.txt.

edited on: 04-19-05 18:54

By: Darren Wiebe (darren) 2005-04-19 18:53:09

Ronald, I'd recomend adding another bugnote for your patches.  I think they look good but it is kind of a separate issue and warrants it's own bugreport IMO.  I would do it but you deserve the karma.

By: Kevin P. Fleming (kpfleming) 2005-04-20 10:49:16

The patch uses a sound file called 'astcc-pleasepin', but that file has not been uploaded. What is the status of the sound files posted here, can the older ones be removed?

Ronald: please hold on to your 'tariff' patches until the PIN patches go in.

By: Kevin P. Fleming (kpfleming) 2005-04-20 12:50:29

This patch will need to make accomodations for people who upgrade without adding a 'pin' column to the appropriate database table. I'm not sure what the right technique will be, but there has to be _some_ handling for this issue, otherwise it will break people's systems.

Can you come up with a logical way to handle backwards compatibility?

By: Darren Wiebe (darren) 2005-04-20 21:43:11

Yes, please remove the old ones.  I will see what I can do for the pin column.

By: Kevin P. Fleming (kpfleming) 2005-04-26 23:24:43

Any updates here? There are a number of people anxious to get this one in :-)

By: Darren Wiebe (darren) 2005-04-29 19:34:16

I just looked over it.  I don't have a better method for the pin support but I did a bit of testing on my box.  I don't have the pin field added to the database but I have updated the configuration since I updated the software and all I had to do to get it to work was set the pin support to NO.

By: Kevin P. Fleming (kpfleming) 2005-04-29 19:40:38

I can see how that would be true for the AGI (as long as the 'pinstatus' can be made to default off without requiring a new config entry), but the CGI script has an INSERT statement for adding new cards that assumes the pin column will be present. That means people will have to add that column if they want to use this script for admin of their astcc database, unless I'm mistaken.

By: Darren Wiebe (darren) 2005-04-29 19:40:57

I just ordered the pleasepin sound file from Allison.  I wonder if she works weekends? :-(  I'll send it in as soon as I get it.  It says "Please enter your"

By: Darren Wiebe (darren) 2005-04-29 22:04:56

Thanks, sorry about my mental block.  The issue was not dealt with in the patches for "nextfee" but I will have a look.  What I've done is added an update_database button to the configure page.  Will that work?  I'm going to test it now.

By: Darren Wiebe (darren) 2005-04-29 22:20:21

It does not like me and gives me an error 15 when I try to upload a file but I have the latest patch ready.  You can email me @ darren@aleph-com.net for details.

By: Darren Wiebe (darren) 2005-04-29 23:54:12

OK, it just let me upload the latest patch.  I will upload the last sound file as soon as I get it.

By: Darren Wiebe (darren) 2005-05-02 18:58:37

I just uploaded the last sound file.

By: Michael Jerris (mikej) 2005-05-04 21:02:34

This appears to be ready to go with the  astcc-patch.txt patch.  

Ronald, please open another bug  for the tariff features.

By: Darren Wiebe (darren) 2005-05-12 21:18:55

Any updates?

By: Kevin P. Fleming (kpfleming) 2005-05-15 01:47:12

Committed to CVS HEAD, thanks!