Decimal Operation

Discussion in 'General' started by sergiogal, May 21, 2009.

  1. sergiogal

    Joined:
    Nov 26, 2007
    Messages:
    18
    Likes Received:
    0
    Hi,
    I'have this extension:

    exten => h,n,Noop(--- CDR(billsec) : ${CDR(billsec)})
    exten => h,n,Noop(--- Tarifa : ${tarifa})
    exten => h,n,Set(tasacion=$[${CDR(billsec)} * ${tarifa}])

    And this is the result after a call:

    -- Executing [h@Discar:4] NoOp("SIP/5555109903-a8ca6ef0", "--- CDR(billsec) : 3") in new stack
    -- Executing [h@Discar:5] NoOp("SIP/5555109903-a8ca6ef0", "--- Tarifa : 0.07") in new stack
    -- Executing [h@Discar:6] Set("SIP/5555109903-a8ca6ef0", "tasacion=0") in new stack
    -- Executing [h@Discar:7] NoOp("SIP/5555109903-a8ca6ef0", "--- Tasacion : 0") in new stack

    Why the variable "tasacion" is equal to 0 ??

    HELP!!!
    Thanks

    Sergio
     
  2. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    Try the following:

    Code:
    exten => h,n,Set(tasacion=$[ ${CDR(billsec)} * ${tarifa} ])
    
    That is a common mistake, to don't leave a space between the []
     

Share This Page