0% found this document useful (0 votes)
116 views23 pages

Astcc Documentation

This document provides information about installing and configuring the asterisk calling card system (ASTCC). It includes sections describing the requirements, download and installation steps, database setup in MySQL, configuration files, and FAQs. The document is intended to guide users through the complete process of getting ASTCC up and running on their Asterisk system for processing calling card calls.

Uploaded by

ff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views23 pages

Astcc Documentation

This document provides information about installing and configuring the asterisk calling card system (ASTCC). It includes sections describing the requirements, download and installation steps, database setup in MySQL, configuration files, and FAQs. The document is intended to guide users through the complete process of getting ASTCC up and running on their Asterisk system for processing calling card calls.

Uploaded by

ff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

The asterisk calling card system

Compiled by:
Anil Madikonda
[email protected]

Table of contents:
Description............................................................................................................ 3
Requirements .............................................................................................................3
Download ASTCC .....................................................................................................4
Installing Perl on Unix ...............................................................................................5
ASTCC Setup Check List:..........................................................................................6
Step by Step Install of ASTCC?: ................................................................................7
Manual Install: ...........................................................................................................8
Astcc-config.conf .......................................................................................................8
Astcc-exten.conf ........................................................................................................9
Installing the database in MySQL :...........................................................................11
Mysql database Structure:.....................................................................................11
FAQ .....................................................................................................................14
BUGS...................................................................................................................14
BRANDS .........................................................................................................15
CARDS ............................................................................................................15
TRUNKS..........................................................................................................15
ROUTES ..........................................................................................................15
CONFIGURE ...................................................................................................15
IAX and SIP FRIENDS ....................................................................................15
PROBLEMS.....................................................................................................15
OTHER NOTES...............................................................................................16
Comments:...............................................................................................................17
A kind of solution for RTP cuts before time (last_minute) ................................17
Brands ..............................................................................................................17
Astcc prefix with VoIpjet..................................................................................18
Re: Table changes & brands .............................................................................18
Table changes & brands....................................................................................18
Re: diff to support firstused and expiration .......................................................18
astcc .................................................................................................................18
Re: diff to support firstused and expiration .......................................................19
more user doc ...................................................................................................19
diff to support firstused and expiration..............................................................19
.............................................................................................................20
...........................................................................................................21

Description

Requirements

$%
&

''
"

#!

"

#!

Download ASTCC
(

'
export CVSROOT=:pserver:[email protected]:/usr/cvsroot
cvs login
## (password is anoncvs)
cvs co astcc

Installing Perl on Unix


"
-

#!

*
"

0"
,

+
,
."
0"

#!

"

#!
/

! 1)
0 ")

+
,

, )
,

0"
)

'2
2

3
.4
Just tried this for Debian and it seems to work for me: "aptget install libdbd-mysql".
Then you don't need to do the cpan things... Helped me a lot.
5
3
67 .4
apt-get install libdbd-mysql-perl
5
1
6"
6
3$
3$3''

'

3$3
*

*
"

#!

,
)

3$3
*
3$

''3
3$

8
)

'

3$

'
< = 3$ 6(70 >

<?

1, 6
@3$ 6(70 > +
6 ,

'

3$ 6

(70 >
$

'

,
3$3''
)

"

#!

+
'2
2
!

#!)
"

,
3$3''

"

"

,
3$

#!

,
<
@@

)
21

'
2
"

A
0*

"

+
+

ASTCC Setup Check List:


(
,

"
6

,
,

2
, 2 2

)
2
, 2

2 6

Step by Step Install of ASTCC?:

(
+

,
+

make install

6
6

6
2
, 2

2 6

2
, 2 2
2
, 2 2

2 6
6

2
6
2 6

Manual Install:
If there is any problem
2
, 2 2
2
, 2
2
6
2
, 2
BBB2
, 2

6
2
2
, 2
2
2

2
, 2 2

,2
, 2 2

create them and copy files manually as under.

6
2 6
2 6

'

6
'

Astcc-config.conf
'
C

C,

D >
D
E
D&
D
D >
D
D
D >
D >
DF
,
D 97
D
D
D
D
D 97 :

:
:

D GH

Astcc-exten.conf
:
:
:
:

6
1
1

D; IHH%%%%%%%%%)
J)
3
D; IHH%%%%%%%%%)
L)
/

:
:
:

)
K4

!!70 3

"5)
K47% 7 5.

6
1
1
1

D; JLGF)
J)
D; JLGF)
L)
3
D; JLGF)
G)
/

C
$!

7C

):

1
1
1

D; IHH%%%%%%%%%)
J)
3
D; IHH%%%%%%%%%)
L)
/

)
K4

!!70 3

"5)
$!

7)
J.

:9
1
1
1

BB
D; BB)
J)
D; BB)
L)
3
D; BB)
G)
/

:
1
1

)
D; IJ %% %%%%%%)
J)
3
D; IJ %% %%%%%%)
L)
/

)
K4

!!70 3

"5)
K47% 7 5.

1
1

)
D; IJ %% %%%%%%)
J)
3
D; IJ %% %%%%%%)
L)
/

)
K4

!!70 3

"5)
)
F.

6 1
1
1
1

D; IBB)
J)
D; IBB)
L)
3
D; IBB)
G)
/

BBM

)
K4

!!70 3

"5)
K47% 7 'L5)
G.

BB.
)
.

D
D

+
7% 7 'L+

8N3 70 3LDOFBPLG
8N3L 70 "7D
Q
8N3 078%DR
:
exten
exten
exten
exten
exten

6
=>
=>
=>
=>
=>

s,1,Answer
s,2,Wait,1
s,3,Playback(ss-noservice)
s,4,Wait(30)
s,5,Hangup

>
>
exten => 213,1,Answer
exten => 213,2,DeadAGI(astcc.agi)
exten => 213,3,Hangup
:

)
1
1
1

D; %%%%%%)
J)
3
D; %%%%%%)
L)
/
D; %%%%%%)
J)
3 D;

)
K4

!!70 3

"5)
K47% 7 5.

2
K47% 7 5.

J6

:
include = /var/lib/astcc/astcc-exten.conf
9

6
,

)
)

Installing the database in MySQL :


Create the astcc db using phpmyadmin and import the following database sql file

Mysql database Structure:


66 "
66
66 /
66
66
66
66

#!
'
, ,

SLG
3

'

GLG&S

07 7 $!7@
@`name` varchar(40) NOT NULL default '',
`language` varchar(10) default NULL,
`inc` char(3) default '30',
`publishednum` varchar(40) default NULL,
`did` varchar(40) default NULL,
`markup` int(11) default NULL,
`days` char(3) default '0',
`fee` int(11) default NULL,
PRIMARY KEY (`name`)
. 9 7D"
":
66
66 3
66

70
>@
@( ! 7
+
7< +
)
+ +
)
+
P+
)
+
JLJL&HLGJLG+
)
+
JLJLGF&LJGF+
)
JH)
+
GH+
)
JH.
:
66
66
66

07 7 $!7@
@`number` char(20) NOT NULL default '',
`language` char(10) default NULL,
`facevalue` int(11) default NULL,
`used` int(11) NOT NULL default '0',
`inc` int(11) NOT NULL default '0',
`markup` int(11) NOT NULL default '0',
`creation` timestamp(14) NOT NULL,
`firstuse` timestamp(14) NOT NULL,
`expiration` timestamp(14) NOT NULL,
`inuse` int(11) default NULL,
`brand` char(40) default NULL,
`nextfee` int(11) default NULL,
`pin` char(20) default NULL,
PRIMARY KEY (`number`)
. 9 7D"
":
66
66 3
66

70
>@
@( ! 7
+
JLLJOOSGOJGF&OP&GJ&P+
)
+ +
)
JHHHH)
H)
P)
JH)
LHH&H&JLJ&F&H&)
HHHHHHHHHHHHHH)
HHHHHH
HHHHHHHH) !!)
+
7< +
)
GH.
:
70
>@
@( ! 7
+
JJSOSLBP&BSBL&G&BPJO+
)
+ +
)
JHHHH)
H)
P)
JH)
LHH&H&JLJ&F&H&)
HHHHHHHHHHHHHH)
HHHHHH
HHHHHHHH) !!)
+
7< +
)
GH.
:
66
66
@
@
66
07 7 $!7@
@`cardnum` char(40) NOT NULL default '',
`callerid` char(80) default NULL,
`callednum` char(80) default NULL,
`trunk` char(40) default NULL,
`disposition` char(20) default NULL,
`billseconds` int(11) default NULL,
`billcost` int(11) default NULL,
`callstart` char(24) default NULL,
PRIMARY KEY (`cardnum`)
. 9 7D"
":
66
66
66

@ 1

07 7 $!7@ 1
@`name` char(40) NOT NULL default '',
`secret` char(40) default NULL,
`context` char(40) default NULL,
`ipaddr` char(20) default NULL,
`port` int(6) default NULL,
`regseconds` int(11) NOT NULL default '0',
PRIMARY KEY (`name`)
. 9 7D"
":
66
66
66

07 7 $!7@
@`pattern` char(40) NOT NULL default '',
`comment` char(80) default NULL,
`trunks` char(80) default NULL,
`connectcost` int(11) NOT NULL default '0',
`includedseconds` int(11) NOT NULL default '0',
`cost` int(11) NOT NULL default '0',
PRIMARY KEY (`pattern`)
. 9 7D"
":
66
66 3
66
70
66
66
66

>@

@( ! 7 +
JR+
)
+

+
)
+

07 7 $!7@
@`name` char(40) NOT NULL default '',
`username` char(40) default NULL,
`secret` char(40) NOT NULL default '',

+
)
J)
GH)
L.
:

`context` char(40) NOT NULL default '',


`ipaddr` char(20) NOT NULL default '',
`port` int(6) NOT NULL default '0',
`regseconds` int(11) default '0',
PRIMARY KEY (`name`)
. 9 7D"
":
66
66
66

07 7 $!7@
@`name` char(40) NOT NULL default '',
`tech` char(10) default NULL,
`path` char(40) NOT NULL default '',
PRIMARY KEY (`name`),
KEY `pk_trunks` (`name`)
. 9 7D"
":
66
66 3
66

70

>@

@( ! 7 +

+
)
+ +
)
+

+
.
:

FAQ
#' J N
T

'N

)
!
)
,

71
1

#'

.
)

'

)
N

#' N
'$

)
3 3) )
"

- J2
JHH

JX.

J.
/

' 9 )K47% 7 5
,

BBU

K47% 7 'L5U

K47% 7 ' 5
.

)-

L.
/

U
U

'

.
G.N

%I

'0

J
L
G
F
&
P
B

I8

3>

J6
L6
G6
F6

>

BUGS
LHH&6HP6JP.
,

PHH)

9
:6.

K W
DD H.4
$maxmins = 600;
5
4
$maxmins = int(($credit - $adjconn) / $adjcost);
5

)
,
"

,
8

0!
3$

-W

, Y

2
0!
,

U. 9

2
%

JHHH -

/
" 1
+
+
.

KJH

)
)

,
1

)
)

!0
8
1
)
)
+
[HJJ&LR+J2
JHH

9
7

,
P

)
%

3$

3$
,
C
7

JL

.
,

, Y

Y
+

+
*
)

1L

30 )

+
)

,
)

)
,

)
3

- .

'

'

LB2
LHH&' 3
,

,
,

,
1
)

)
)

,
)

W
)
+

,
)
+

Comments:
!
BB

"

#$

LH

!$

%$&

'%

$(

)LHH&\
HB'GO'H&]

/
^,

PH

GH

<
6 6<

<
'

DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
if ($res->{tech} eq "Zap") {
$dialstr = "Zap/$res->{path}/$phone|30|HL(" . ($maxtime *
PHRJHHH. C
'HHHHH'HHHHH.
C
:
$res = $AGI->exec("DIAL $dialstr");
$answeredtime = $AGI->get_variable("ANSWEREDTIME");
$dialstatus = $AGI->get_variable("DIALSTATUS");
$callstart = localtime();
return $dialstatus;
}
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

6 ,

,
W

PH

GH

)
0 )0

!
JOBL
$
! +

HG
&HX

C
&HX
C
&HX
W

L&HH
B&HH

)LHH&\
JO'JS'HP]

L&X
B&X

C
C

C
&HHHC

"" )!$ * + , - ).$


JOBL
'

"

LO

)LHH&\
HF'FG'LP]

'.

(
(

W)
+

W
HJJ
HJJ

U
HJJ47% 7 5)
7% 7

$/

# $ ",

# $ ",

0$ 1 #!

0$ 1 #!
N

HL

"

)LHH&\
LG'HH'JH]

+
+
07 7 $!7
pattern char(40) NOT NULL default '',
comment char(80) default NULL,
country char(40) default NULL,
city char(40) default NULL,
type char(10) default NULL,
trunks char(80) default NULL,
connectcost int(11) NOT NULL default '0',
includedseconds int(11) NOT NULL default '0',
cost int(11) NOT NULL default '0',
PRIMARY KEY (pattern)
.
G

'

$*) !

'

+
U

$/

)) !

HS

)LHH&\
LJ'GP'GP]

)
I have a patch up on bugs.digium.com that accomplishes what you're looking
for (and more). I put installation instructions there.
'2
2

I,

) !7

I DHHHGLPO

""
8

HG

)LHHF\
HS'JB'LP]

3
,

71

PHHH

LHHH

$/

)) !

$
LO

$*) !
>

)LHHF\
JJ'JO'HL]

(U

3
,

<
3

% !$

$!

"
LJ

>

)LHHF\
HB'HJ'HO]

,
1

E,
,

1
,
, IJ %% %%%%%%%

C
JC

)) !

!
8

$*) !

JH

)LHHF\
HS'JJ'FP]

PL PG)
PB
; -K
6;4
5DD H.4
;K
6; C 3 7
7
D
;K
6;*
K
6;4
5.
.
:
;
;5
PS BG
C 7!7 R80>"
N/707
.
.
:
;K
DK
6;
.
DH
1I
6;*
K
.
.
:

C 7!7
-1

R80>"
.;
1I

DC

DC K

6;*

N/707- 1I
.
.
.

-1
DC K

"" 2

$/

,
6 *
#! 3

+
.

" *)W

3$3'' #!

'

3
+,
!!'

2
, 2 2

6
2
, 2

#!
2
, 2 2
2
8

, -

+
*

6
2 2 6
6

LHHF2
HO2
JG'

81

0!Q7$

6 #!
0
2

0!Q7

Z
)

"!$$
/

6$

6!

6/

60

You might also like