[Asterisk-Dev] !!!prepaid.c from WIKI :Playing 'prepaid-dest-unreachable' (language 'en')

Greg Renouf grenouf at well.com
Mon May 3 12:48:57 MST 2004


Check the version of PostgreSQL you are using.  I use 7.4 and had to
make some changes to some of the SQL functions.  Some Postgresql
commands (e.g. ROUND) were not compatible with v.7.4.

Here is my altered (hack) copy of ast_acct_stop:
DECLARE

    p_uniqueid ALIAS FOR $1;
    p_sessionid ALIAS FOR $2;
    p_username ALIAS FOR $3;
    p_calledstation ALIAS FOR $4;
    p_rate ALIAS FOR $5;
    p_sessiontime ALIAS FOR $6;
    p_terminatecause ALIAS FOR $7; 
    p_stoptime ALIAS FOR $8;

    used INTEGER;
    
BEGIN


UPDATE call SET sessiontime=p_sessiontime, calledstation=p_calledstation, terminatecause=p_terminatecause, stoptime=p_stoptime WHERE uniqueid=p_uniqueid;

used := 5 + ROUND(((p_rate * p_sessiontime) / 60),0);

update card set credit=(credit - used) where username=p_username;

RETURN 0;

END



-GSR


On Mon, 2004-05-03 at 19:03, Igor C.Iovchevski wrote:
> hello
> 
> could you please help me with this.
> I am trying to use the prepaid from WIKI.
> I installed POSTGRESQL, and recompiled asterisk with the .C file included.
> I get IVR prompts until I dial the number.It reads the account cash, and 
> asks me for the number.
> then, after I dial the number, it says :::
> -----Playing 'prepaid-dest-unreachable' (language 'en')
> 
> I popuilated the tarrifs and providers fields, but I dont know how things 
> work.
> please give me a tip on this.
> 
> thank you.
> 
> Igor Jovchevski
> 
> Macedonia
> 
> 
> 
> 




More information about the asterisk-dev mailing list