[Home]

Summary:ASTERISK-02041: [patch] Some enhancements for astcc
Reporter:oliver (oliver)Labels:
Date Opened:2004-07-17 10:04:08Date Closed:2004-09-25 02:11:24
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) diff
( 1) diff2
( 2) diff3
Description:As there's no category for astcc here yet, I'm posting it under "general".

From my posting to the developers-list:

Great app!  I bumped into several minor problems:                              
                                                                               
- The admin-script, when asking it to create the database, it literally        
tries to add the database itself, instead of just trying to populate            
an existing database you give it.  If it finds that the database was            
already created and just needs to be populated, it fails completely.            
Took me some time to track that one down.  :-)                                  
                                                                               
- The AGI-script does not support the Zap-technology out of the box,            
neither does it enforce any time-limits (although the latter seems to          
have been prepared, except that "$maxmins" is not passed to "trytrunk()".      
                                                                               
- After enabling the time-limit, I noticed that there can be situations        
in which the call goes through, but with "$maxmins" set to "0", if the          
caller has exactly the amount of credit left to set up the call.  This          
would allow the call to go on for an unlimited time.  :-)                      
                                                                               
- The handling of the time-limit could be done much more graceful              
using the "L"-option to app_dial, so the caller can be warned in advance        
before the call is hung up.                                                    
                                                                               
                                                                               
I've attached a diff to this mail, fixing the last 3 points mentioned          
above.  Adding support for the "Local" channel, as already suggested            
on the list, should also be trivial.



  Grtz,

     Oliver
Comments:By: Mark Spencer (markster) 2004-07-17 12:15:29

We will need an update disclaimer to cover astcc.  I've updated the disclaimers on the web site to cover it.

By: oliver (oliver) 2004-07-17 17:00:32

Hey Mark,

I'll have a look at the updated disclaimer.

BTW: Another problem I noticed in the current astcc is the lack of simultaneous use-protection.  I'm working on that as well, adding an "inuse"-field to the card-table for it.  It gets set just before the outgoing call is dialled and cleared again once it finishes.  I've come across 1 problem:  If the caller hangs up after the call is dialled, while it is still ringing, the AGI-script seems to get killed before it can finish "trytrunk()" and the "inuse"-flag will not be cleared.  I thought about putting the PID of the current AGI-process in the "inuse"-field and checking if that PID still exists in order to determine if the card is in use, but that wouldn't work if multiple machines would be used with the same database.  Maybe someone has some input on this.


  Grtz,

    Oliver

By: Mark Spencer (markster) 2004-07-17 17:09:42

Actually the concurrancy should be done with SetGroup and GroupCount.

By: oliver (oliver) 2004-07-17 18:25:00

Hey Mark,

That still won't work across multiple machines, which is why I was hoping to implement it through a flag in the database.  BTW, I already found the problem and fixed it.  Will post a new patch as soon as I have done a bit of testing.


  Grtz,

     Oliver

edited on: 07-17-04 19:00

By: Mark Spencer (markster) 2004-07-18 22:44:56

We could setup another cleanup agi script on the h extension presumably.  Anyway go ahead and get the disclaimer and then lets talk about the rest.

By: Mark Spencer (markster) 2004-07-20 18:55:51

Where do we stand here?

By: oliver (oliver) 2004-07-21 09:00:35

Hey Mark,

I got the locking to work as well, but will still need to find some time to make some changes.  As of now, it locks right before the dialout and unlocks after the call has been cleared.  I want to change it to lock right after entering a valid card-number and unlock on exit, but there are quite a lot of exits in the script, which would all need to be covered, to prevent an exit without an unlock.  I'll probably implement this as "exitinuse()" and change all calls to "exit()" after card-validation to that.

Once I'm happy with it, I'll post new diffs and FAX you the updated disclaimer.



  Grtz,

     Oliver

By: oliver (oliver) 2004-07-21 12:27:52

Hey Mark,

Here's an updated version (diff2).  Changes include:

- simultaneous use-protection, with lock in database.  Requires an "inuse"-field in the card-table.
- "Zap"-technology on trunks now works.
- Call duration-limits based on credit left are now enforced, warning the caller 1 minute before credit runs out.
- Now uses the more flexible "L"-option to app_dial to enforce duration-limits.
- Script can now be called with the card-number and phone-number on the command-line.
- Some small typo's, warnings and buglets fixed.

Note: I haven't tested these changes extensively yet.


   Grtz,

      Oliver

By: Mark Spencer (markster) 2004-07-22 00:14:06

Great, did you get a chance to send in the disclaimer?

By: oliver (oliver) 2004-07-23 06:04:54

Hey Mark,

Not yet.  Will let you know.  Meanwhile, I've uploaded an updated version of my patch.


  Grtz,

    Oliver

By: Mark Spencer (markster) 2004-08-07 18:36:57

Yo, is this going in soon or not, need to clear out some bugs :)

Still waiting to hear if you sent in a new disclaimer.  Thanks!

By: oliver (oliver) 2004-08-09 11:52:41

Hey Mark,

I faxed the disclaimer about 30 minutes ago.  Let me know if it's OK.


  Grtz,

    Oliver

By: Mark Spencer (markster) 2004-08-09 15:42:56

Okay merged, except for one part of the patch which failed.  You might want to redo the "S" stuff in it and do a new bug report.  Thanks for taking the time to make enhancements to astcc!

By: oliver (oliver) 2004-08-09 19:28:28

Hey Mark,

There's one more small related patch you'll need to make.  The admin-script will need to create the "inuse"-field in the cards-table, which my patches use for simultaneous use-protection.  Can you fix that as well?

I'll merge the failed part of my diff back in as well (and maybe inplement support for chan_local), but will open a new ticket for that.


   Grtz,

     Oliver

By: Mark Spencer (markster) 2004-08-10 07:27:59

Okies, I added the field as an integer hope thats okay.