FreeSWITCH and CGRateS configuration - need help

641 views
Skip to first unread message

Faruk Ahmed

unread,
Jul 13, 2014, 11:07:07 PM7/13/14
to cgr...@googlegroups.com
Hi

I am trying to integrate FreeSWITCH and CGRateS in Debian Wheezy. I am having trouble to have rater to debit the balances. Do not see any real-time event in the syslog. I have done the following -
a) includec the cgr_dialplan.xml in the dialplan/default folder
b) edited the 1001 and 1002 extension as prepaid account
c) added the cdr_csv xml conf file in the autoload directory

Here is the log from syslog

Jul 13 19:57:47 debian CGRateS[20658]: Registering Rater service
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS Scheduler.
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS Mediator service.
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS CDRS service.
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS SessionManager service.
Jul 13 19:57:47 debian CGRateS[20658]: Caching all destinations
Jul 13 19:57:47 debian CGRateS[20658]: Finished destinations caching.
Jul 13 19:57:47 debian CGRateS[20658]: Caching all rating plans
Jul 13 19:57:47 debian CGRateS[20658]: Finished rating plans caching.
Jul 13 19:57:47 debian CGRateS[20658]: Caching all rating profiles
Jul 13 19:57:47 debian CGRateS[20658]: Finished rating profile caching.
Jul 13 19:57:47 debian CGRateS[20658]: Caching rating profile aliases
Jul 13 19:57:47 debian CGRateS[20658]: Caching all actions
Jul 13 19:57:47 debian CGRateS[20658]: Finished actions caching.
Jul 13 19:57:47 debian CGRateS[20658]: Caching all shared groups
Jul 13 19:57:47 debian CGRateS[20658]: Caching account aliases
Jul 13 19:57:47 debian CGRateS[20658]: Registering Mediator RPC service.
Jul 13 19:57:47 debian CGRateS[20658]: <FSock> Successfully connected to FreeSWITCH!
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS JSON server at 127.0.0.1:2012.
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS GOB server at 127.0.0.1:2013.
Jul 13 19:57:47 debian CGRateS[20658]: Starting CGRateS HTTP server at 127.0.0.1:2080.


Here is the ngrep output

##
T 127.0.0.1:46025 -> 127.0.0.1:8021 [AP]
  api uuid_setvar ec7c8aeb-75c1-4a75-a341-5cfb0bd27b40 cgr_reqtype prepaid....                                                          
#
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  Content-Type: api/response.Content-Length: 4..                                                                                        
#
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  +OK.                                                                                                                                  
##
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  Content-Length: 15180.Content-Type: text/event-plain..                                                                                
#
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  Event-Name: CHANNEL_HANGUP_COMPLETE.Core-UUID: 28783acd-8c9e-4b1d-82e8-2e98ee02f41f.FreeSWITCH-Hostname: debian.FreeSWITCH-Switchname:
  debian.FreeSWITCH-IPv4: 192.168.1.97.FreeSWITCH-IPv6: %3A%3A1.Event-Date-Local: 2014-07-13%2020%3A01%3A03.Event-Date-GMT: Mon,%2014%20J
  ul%202014%2003%3A01%3A03%20GMT.Event-Date-Timestamp: 1405306863368031.Event-Calling-File: switch_core_state_machine.c.Event-Calling-Fun
  ...........

Could you please point me what I have missed ?

Thank you much.

Dan Christian Bogos

unread,
Jul 14, 2014, 2:55:01 AM7/14/14
to cgr...@googlegroups.com
Hi Faruk,

Could you please post me a full ngrep of the communication with FreeSWITCH. On the other hand, can u also show the result of an get_account console command, in order to see your account's balance status?

Thanks,
Dan
--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.
To post to this group, send email to cgr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cgrates/7108ef41-f345-4740-a564-8dea7eb87a75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Faruk Ahmed

unread,
Jul 14, 2014, 11:26:53 AM7/14/14
to cgr...@googlegroups.com
Hi Dan,

Thank you, here is the total log of ngrep for one call -
  api uuid_setvar 2a9b643b-09f0-4a9d-b0a6-4eff2be8bece cgr_reqtype prepaid....                                                     
#
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  Content-Type: api/response.Content-Length: 4..                                                                                   
#
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  +OK.                                                                                                                             
##
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  Content-Length: 15187.Content-Type: text/event-plain..                                                                           
#
T 127.0.0.1:8021 -> 127.0.0.1:46025 [AP]
  Event-Name: CHANNEL_HANGUP_COMPLETE.Core-UUID: 28783acd-8c9e-4b1d-82e8-2e98ee02f41f.FreeSWITCH-Hostname: debian.FreeSWITCH-Switchn
  ame: debian.FreeSWITCH-IPv4: 192.168.1.97.FreeSWITCH-IPv6: %3A%3A1.Event-Date-Local: 2014-07-14%2000%3A25%3A11.Event-Date-GMT: Mon
  ,%2014%20Jul%202014%2007%3A25%3A11%20GMT.Event-Date-Timestamp: 1405322711997077.Event-Calling-File: switch_core_state_machine.c.Ev
  ent-Calling-Function: switch_core_session_reporting_state.Event-Calling-Line-Number: 832.Event-Sequence: 4558.Hangup-Cause: NORMAL
  _CLEARING.Channel-State: CS_REPORTING.Channel-Call-State: HANGUP.Channel-State-Number: 11.Channel-Name: sofia/internal/1001%40192.
  168.1.97.Unique-ID: 2a9b643b-09f0-4a9d-b0a6-4eff2be8bece.Call-Direction: inbound.Presence-Call-Direction: inbound.Channel-HIT-Dial
  plan: true.Channel-Presence-ID: 1001%40192.168.1.97.Channel-Call-UUID: 2a9b643b-09f0-4a9d-b0a6-4eff2be8bece.Answer-State: hangup.H
  angup-Cause: NORMAL_CLEARING.Channel-Read-Codec-Name: PCMU.Channel-Read-Codec-Rate: 8000.Channel-Read-Codec-Bit-Rate: 64000.Channe
  l-Write-Codec-Name: PCMU.Channel-Write-Codec-Rate: 8000.Channel-Write-Codec-Bit-Rate: 64000.Caller-Direction: inbound.Caller-Logic
  al-Direction: inbound.Caller-Username: 1001.Caller-Dialplan: XML.Caller-Caller-ID-Name: 1001.Caller-Caller-ID-Number: 1001.Caller-
  Orig-Caller-ID-Name: 1001.Caller-Orig-Caller-ID-Number: 1001.Caller-Callee-ID-Name: Outbound%20Call.Caller-Callee-ID-Number: 1002.
  Caller-Network-Addr: 192.168.1.82.Caller-ANI: 1001.Caller-Destination-Number: 1002.Caller-Unique-ID: 2a9b643b-09f0-4a9d-b0a6-4eff2
  be8bece.Caller-Source: mod_sofia.Caller-Context: default.Caller-Channel-Name: sofia/internal/1001%40192.168.1.97.Caller-Profile-In
  dex: 1.Caller-Profile-Created-Time: 1405322670023298.Caller-Channel-Created-Time: 1405322670023298.Caller-Channel-Answered-Time: 1
  405322673303676.Caller-Channel-Progress-Time: 1405322670139760.Caller-Channel-Progress-Media-Time: 1405322670163145.Caller-Channel
  -Hangup-Time: 1405322711644508.Caller-Channel-Transfer-Time: 0.Caller-Channel-Resurrect-Time: 0.Caller-Channel-Bridged-Time: 14053
  22673303676.Caller-Channel-Last-Hold: 1405351302183254.Caller-Channel-Hold-Accum: 38157312.Caller-Screen-Bit: true.Caller-Privacy-
  Hide-Name: false.Caller-Privacy-Hide-Number: false.Other-Type: originatee.Other-Leg-Direction: outbound.Other-Leg-Logical-Directio
  n: inbound.Other-Leg-Username: 1001.Other-Leg-Dialplan: XML.Other-Leg-Caller-ID-Name: Extension%201001.Other-Leg-Caller-ID-Number:
   1001.Other-Leg-Orig-Caller-ID-Name: 1001.Other-Leg-Orig-Caller-ID-Number: 1001.Other-Leg-Callee-ID-Name: Outbound%20Call.Other-Le
  g-Callee-ID-Number: 1002.Other-Leg-Network-Addr: 192.168.1.82.Other-Leg-ANI: 1001.Other-Leg-Destination-Number: 1002.Other-Leg-Uni
  que-ID: 3f549bbf-86a2-40e7-a202-6fcf8bd8f62d.Other-Leg-Source: mod_sofia.Other-Leg-Context: default.Other-Leg-Channel-Name: sofia/
  internal/sip%3A1002%40192.168.1.82%3A5060.Other-Leg-Profile-Created-Time: 1405322670076417.Other-Leg-Channel-Created-Time: 1405322
  670076417.Other-Leg-Channel-Answered-Time: 1405322673283577.Other-Leg-Channel-Progress-Time: 1405322670139760.Other-Leg-Channel-Pr
  ogress-Media-Time: 0.Other-Leg-Channel-Hangup-Time: 0.Other-Leg-Channel-Transfer-Time: 0.Other-Leg-Channel-Resurrect-Time: 0.Other
  -Leg-Channel-Bridged-Time: 0.Other-Leg-Channel-Last-Hold: 0.Other-Leg-Channel-Hold-Accum: 0.Other-Leg-Screen-Bit: true.Other-Leg-P
  rivacy-Hide-Name: false.Other-Leg-Privacy-Hide-Number: false.variable_direction: inbound.variable_uuid: 2a9b643b-09f0-4a9d-b0a6-4e
  ff2be8bece.variable_session_id: 23.variable_sip_from_user: 1001.variable_sip_from_uri: 1001%40192.168.1.97.variable_sip_from_host:
   192.168.1.97.variable_channel_name: sofia/internal/1001%40192.168.1.97.variable_ep_codec_string: PCMU%408000h%4020i%4064000b,PCMA
  %408000h%4020i%4064000b,G722%408000h%4020i%4064000b,GSM%408000h%4020i%4013200b.variable_sip_local_network_addr: 192.168.1.97.varia
  ble_sip_network_ip: 192.168.1.82.variable_sip_network_port: 5060.variable_sip_received_ip: 192.168.1.82.variable_sip_received_port
  : 5060.variable_sip_via_protocol: udp.variable_sip_authorized: true.variable_Event-Name: REQUEST_PARAMS.variable_Core-UUID: 28783a
  cd-8c9e-4b1d-82e8-2e98ee02f41f.variable_FreeSWITCH-Hostname: debian.variable_FreeSWITCH-Switchname: debian.variable_FreeSWITCH-IPv
  4: 192.168.1.97.variable_FreeSWITCH-IPv6: %3A%3A1.variable_Event-Date-Local: 2014-07-14%2000%3A24%3A30.variable_Event-Date-GMT: Mo
  n,%2014%20Jul%202014%2007%3A24%3A30%20GMT.variable_Event-Date-Timestamp: 1405322670023298.variable_Event-Calling-File: sofia.c.var
  iable_Event-Calling-Function: sofia_handle_sip_i_invite.variable_Event-Calling-Line-Number: 8575.variable_Event-Sequence: 4442.var
  iable_sip_number_alias: 1001.variable_sip_auth_username: 1001.variable_sip_auth_realm: 192.168.1.97.variable_number_alias: 1001.va
  riable_requested_domain_name: 192.168.1.97.variable_record_stereo: true.variable_default_gateway: example.com.variable_default_are
  acode: 918.variable_transfer_fallback_extension: operator.variable_toll_allow: domestic,international,local.variable_accountcode:
  1001.variable_user_context: default.variable_effective_caller_id_name: Extension%201001.variable_effective_caller_id_number: 1001.
  variable_outbound_caller_id_name: FreeSWITCH.variable_outbound_caller_id_number: 0000000000.variable_callgroup: techsupport.variab
  le_cgr_account: 1001.variable_user_name: 1001.variable_domain_name: 192.168.1.97.variable_sip_from_user_stripped: 1001.variable_so
  fia_profile_name: internal.variable_recovery_profile_name: internal.variable_sip_req_user: 1002.variable_sip_req_uri: 1002%40192.1
  68.1.97.variable_sip_req_host: 192.168.1.97.variable_sip_to_user: 1002.variable_sip_to_uri: 1002%40192.168.1.97.variable_sip_to_ho
  st: 192.168.1.97.variable_sip_contact_params: transport%3Dudp%3Bregistering_acc%3D192_168_1_97.variable_sip_contact_user: 1001.var
  iable_sip_contact_port: 5060.variable_sip_contact_uri: 1001%40192.168.1.82%3A5060.variable_sip_contact_host: 192.168.1.82.variable
  _sip_user_agent: Jitsi2.4.4997Mac%20OS%20X.variable_sip_via_host: 192.168.1.82.variable_sip_via_port: 5060.variable_max_forwards:
  70.variable_presence_id: 1001%40192.168.1.97.variable_DP_MATCH: ARRAY%3A%3A1002%7C%3A1002.variable_call_uuid: 2a9b643b-09f0-4a9d-b
  0a6-4eff2be8bece.variable_RFC2822_DATE: Mon,%2014%20Jul%202014%2000%3A24%3A30%20-0700.variable_dialed_extension: 1002.variable_exp
  ort_vars: RFC2822_DATE,dialed_extension.variable_ringback: %25(2000,4000,440,480).variable_transfer_ringback: local_stream%3A//moh
  .variable_call_timeout: 30.variable_hangup_after_bridge: true.variable_continue_on_fail: true.variable_called_party_callgroup: tec
  hsupport.variable_current_application_data: user/1002%40192.168.1.97.variable_current_application: bridge.variable_dialed_user: 10
  02.variable_dialed_domain: 192.168.1.97.variable_inherit_codec: true.variable_originated_legs: ARRAY%3A%3A3f549bbf-86a2-40e7-a202-
  6fcf8bd8f62d%3BOutbound%20Call%3B1002%7C%3A3f549bbf-86a2-40e7-a202-6fcf8bd8f62d%3BOutbound%20Call%3B1002.variable_rtp_use_codec_st
  ring: OPUS,G722,PCMU,PCMA,GSM.variable_rtp_use_codec_name: PCMU.variable_rtp_use_codec_rate: 8000.variable_rtp_use_codec_ptime: 20
  .variable_rtp_last_audio_codec_string: PCMU%408000h%4020i.variable_original_read_codec: PCMU.variable_original_read_rate: 8000.var
  iable_write_codec: PCMU.variable_write_rate: 8000.variable_video_possible: true.variable_local_media_ip: 192.168.1.97.variable_loc
  al_media_port: 22828.variable_advertised_media_ip: 192.168.1.97.variable_rtp_use_pt: 0.variable_rtp_use_ssrc: 1430240066.variable_
  zrtp_secure_media_confirmed_audio: true.variable_zrtp_sas1_string_audio: cdw9.variable_switch_m_sdp: v%3D0%0D%0Ao%3D1002%200%200%2
  0IN%20IP4%20192.168.1.82%0D%0As%3D-%0D%0Ac%3DIN%20IP4%20192.168.1.82%0D%0At%3D0%200%0D%0Am%3Daudio%205095%20RTP/AVP%200%208%209%20
  3%20101%0D%0Aa%3Drtpmap%3A0%20PCMU/8000%0D%0Aa%3Drtpmap%3A8%20PCMA/8000%0D%0Aa%3Drtpmap%3A9%20G722/8000%0D%0Aa%3Drtpmap%3A3%20GSM/
  8000%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0A.variable_read_codec: PCMU.variable_read_rate: 8000.variable_endpoint_dispo
  sition: ANSWER.variable_originate_causes: ARRAY%3A%3A3f549bbf-86a2-40e7-a202-6fcf8bd8f62d%3BNONE%7C%3A3f549bbf-86a2-40e7-a202-6fcf
  8bd8f62d%3BNONE.variable_originate_disposition: SUCCESS.variable_DIALSTATUS: SUCCESS.variable_last_bridge_to: 3f549bbf-86a2-40e7-a
  202-6fcf8bd8f62d.variable_bridge_channel: sofia/internal/sip%3A1002%40192.168.1.82%3A5060.variable_bridge_uuid: 3f549bbf-86a2-40e7
  -a202-6fcf8bd8f62d.variable_signal_bond: 3f549bbf-86a2-40e7-a202-6fcf8bd8f62d.variable_cgr_reqtype: prepaid.variable_last_sent_cal
  lee_id_name: Outbound%20Call.variable_last_sent_callee_id_number: 1002.variable_sip_reinvite_sdp: v%3D0%0D%0Ao%3D1001%200%201%20IN
  %20IP4%20192.168.1.82%0D%0As%3D-%0D%0Ac%3DIN%20IP4%20192.168.1.82%0D%0At%3D0%200%0D%0Am%3Daudio%205091%20RTP/AVP%2096%200%208%209%
  203%2097%2098%20100%20102%20103%20104%20105%20106%20101%0D%0Aa%3Dsendonly%0D%0Aa%3Drtpmap%3A96%20SILK/8000%0D%0Aa%3Drtpmap%3A0%20P
  CMU/8000%0D%0Aa%3Drtpmap%3A8%20PCMA/8000%0D%0Aa%3Drtpmap%3A9%20G722/8000%0D%0Aa%3Drtpmap%3A3%20GSM/8000%0D%0Aa%3Drtpmap%3A97%20iLB
  C/8000%0D%0Aa%3Drtpmap%3A98%20opus/48000/2%0D%0Aa%3Dfmtp%3A98%20usedtx%3D1%0D%0Aa%3Drtpmap%3A100%20SILK/24000%0D%0Aa%3Drtpmap%3A10
  2%20SILK/16000%0D%0Aa%3Drtpmap%3A103%20SILK/12000%0D%0Aa%3Drtpmap%3A104%20speex/32000%0D%0Aa%3Drtpmap%3A105%20speex/16000%0D%0Aa%3
  Drtpmap%3A106%20speex/8000%0D%0Aa%3Drtpmap%3A101%20telephone-event/8000%0D%0Aa%3Dextmap%3A1%20urn%3Aietf%3Aparams%3Artp-hdrext%3Ac
  src-audio-level%0D%0Aa%3Dzrtp-hash%3A1.10%2006a0961e4869badc9e6b69dc07ebf4e0f83efc40dfda71e8c9149065aafcefa6%0D%0Am%3Dvideo%200%20
  RTP/AVP%20107%2099%0D%0A.variable_switch_r_sdp: v%3D0%0D%0Ao%3D1001%200%201%20IN%20IP4%20192.168.1.82%0D%0As%3D-%0D%0Ac%3DIN%20IP4
  %20192.168.1.82%0D%0At%3D0%200%0D%0Am%3Daudio%205091%20RTP/AVP%2096%200%208%209%203%2097%2098%20100%20102%20103%20104%20105%20106%
  20101%0D%0Aa%3Drtpmap%3A96%20SILK/8000%0D%0Aa%3Drtpmap%3A0%20PCMU/8000%0D%0Aa%3Drtpmap%3A8%20PCMA/8000%0D%0Aa%3Drtpmap%3A9%20G722/
  8000%0D%0Aa%3Drtpmap%3A3%20GSM/8000%0D%0Aa%3Drtpmap%3A97%20iLBC/8000%0D%0Aa%3Drtpmap%3A98%20opus/48000/2%0D%0Aa%3Dfmtp%3A98%20used
  tx%3D1%0D%0Aa%3Drtpmap%3A100%20SILK/24000%0D%0Aa%3Drtpmap%3A102%20SILK/16000%0D%0Aa%3Drtpmap%3A103%20SILK/12000%0D%0Aa%3Drtpmap%3A
  104%20speex/32000%0D%0Aa%3Drtpmap%3A105%20speex/16000%0D%0Aa%3Drtpmap%3A106%20speex/8000%0D%0Aa%3Drtpmap%3A101%20telephone-event/8
  000%0D%0Aa%3Dsendonly%0D%0Aa%3Dextmap%3A1%20urn%3Aietf%3Aparams%3Artp-hdrext%3Acsrc-audio-level%0D%0Aa%3Dzrtp-hash%3A1.10%2006a096
  1e4869badc9e6b69dc07ebf4e0f83efc40dfda71e8c9149065aafcefa6%0D%0Am%3Dvideo%200%20RTP/AVP%20107%2099%0D%0A.variable_r_sdp_audio_zrtp
  _hash: 1.10%2006a0961e4869badc9e6b69dc07ebf4e0f83efc40dfda71e8c9149065aafcefa6.variable_remote_media_ip: 192.168.1.82.variable_rem
  ote_media_port: 5091.variable_rtp_audio_recv_pt: 0.variable_dtmf_type: rfc2833.variable_rtp_2833_send_payload: 101.variable_rtp_28
  33_recv_payload: 101.variable_rtp_local_sdp_str: v%3D0%0Ao%3DFreeSWITCH%201405299842%201405299845%20IN%20IP4%20192.168.1.97%0As%3D
  FreeSWITCH%0Ac%3DIN%20IP4%20192.168.1.97%0At%3D0%200%0Am%3Daudio%2022828%20RTP/AVP%200%20101%0Aa%3Drtpmap%3A0%20PCMU/8000%0Aa%3Drt
  pmap%3A101%20telephone-event/8000%0Aa%3Dfmtp%3A101%200-16%0Aa%3Dptime%3A20%0Aa%3Dsendrecv%0A.variable_sip_to_tag: m7tgBDQK2DpvD.va
  riable_sip_from_tag: f33811f8.variable_sip_cseq: 3.variable_sip_call_id: 257ef4dde632aecd80acbdd32d6449cd%400%3A0%3A0%3A0%3A0%3A0%
  3A0%3A0.variable_sip_full_via: SIP/2.0/UDP%20192.168.1.82%3A5060%3Bbranch%3Dz9hG4bK-323633-db96ee03551a6bd86210ea5b3c9d0c23.variab
  le_sip_from_display: 1001.variable_sip_full_from: %221001%22%20%3Csip%3A1001%40192.168.1.97%3E%3Btag%3Df33811f8.variable_sip_full_
  to: %3Csip%3A1002%40192.168.1.97%3E%3Btag%3Dm7tgBDQK2DpvD.variable_sip_hangup_phrase: OK.variable_last_bridge_hangup_cause: NORMAL
  _CLEARING.variable_last_bridge_proto_specific_hangup_cause: sip%3A200.variable_bridge_hangup_cause: NORMAL_CLEARING.variable_hangu
  p_cause: NORMAL_CLEARING.variable_hangup_cause_q850: 16.variable_digits_dialed: none.variable_start_stamp: 2014-07-14%2000%3A24%3A
  30.variable_profile_start_stamp: 2014-07-14%2000%3A24%3A30.variable_answer_stamp: 2014-07-14%2000%3A24%3A33.variable_bridge_stamp:
   2014-07-14%2000%3A24%3A33.variable_hold_stamp: 2014-07-14%2008%3A21%3A42.variable_progress_stamp: 2014-07-14%2000%3A24%3A30.varia
  ble_progress_media_stamp: 2014-07-14%2000%3A24%3A30.variable_hold_events: %7B%7B1405351302183260,1405351340340570%7D%7D.variable_e
  nd_stamp: 2014-07-14%2000%3A25%3A11.variable_start_epoch: 1405322670.variable_start_uepoch: 1405322670023298.variable_profile_star
  t_epoch: 1405322670.variable_profile_start_uepoch: 1405322670023298.variable_answer_epoch: 1405322673.variable_answer_uepoch: 1405
  322673303676.variable_bridge_epoch: 1405322673.variable_bridge_uepoch: 1405322673303676.variable_last_hold_epoch: 1405351302.varia
  ble_last_hold_uepoch: 1405351302183254.variable_hold_accum_seconds: 38.variable_hold_accum_usec: 38157312.variable_hold_accum_ms:
  38157.variable_resurrect_epoch: 0.variable_resurrect_uepoch: 0.variable_progress_epoch: 1405322670.variable_progress_uepoch: 14053
  22670139760.variable_progress_media_epoch: 1405322670.variable_progress_media_uepoch: 1405322670163145.variable_end_epoch: 1405322
  711.variable_end_uepoch: 1405322711644508.variable_last_app: bridge.variable_last_arg: user/1002%40192.168.1.97.variable_caller_id
  : %221001%22%20%3C1001%3E.variable_duration: 41.variable_billsec: 38.variable_progresssec: 0.variable_answersec: 3.variable_waitse
  c: 3.variable_progress_mediasec: 0.variable_flow_billsec: 41.variable_mduration: 41621.variable_billmsec: 38341.variable_progressm
  sec: 116.variable_answermsec: 3280.variable_waitmsec: 3280.variable_progress_mediamsec: 140.variable_flow_billmsec: 41621.variable
  _uduration: 41621210.variable_billusec: 38340832.variable_progressusec: 116462.variable_answerusec: 3280378.variable_waitusec: 328
  0378.variable_progress_mediausec: 139847.variable_flow_billusec: 41621210.variable_sip_hangup_disposition: send_bye.variable_rtp_a
  udio_in_raw_bytes: 334500.variable_rtp_audio_in_media_bytes: 334324.variable_rtp_audio_in_packet_count: 1902.variable_rtp_audio_in
  _media_packet_count: 1901.variable_rtp_audio_in_skip_packet_count: 205.variable_rtp_audio_in_jitter_packet_count: 0.variable_rtp_a
  udio_in_dtmf_packet_count: 0.variable_rtp_audio_in_cng_packet_count: 0.variable_rtp_audio_in_flush_packet_count: 1.variable_rtp_au
  dio_in_largest_jb_size: 0.variable_rtp_audio_in_jitter_min_variance: 57.14.variable_rtp_audio_in_jitter_max_variance: 436.20.varia
  ble_rtp_audio_in_jitter_loss_rate: 0.00.variable_rtp_audio_in_jitter_burst_rate: 0.00.variable_rtp_audio_in_mean_interval: 21.10.v
  ariable_rtp_audio_in_flaw_total: 0.variable_rtp_audio_in_quality_percentage: 100.00.variable_rtp_audio_in_mos: 4.50.variable_rtp_a
  udio_out_raw_bytes: 20456.variable_rtp_audio_out_media_bytes: 20456.variable_rtp_audio_out_packet_count: 117.variable_rtp_audio_ou
  t_media_packet_count: 117.variable_rtp_audio_out_skip_packet_count: 0.variable_rtp_audio_out_dtmf_packet_count: 0.variable_rtp_aud
  io_out_cng_packet_count: 0.variable_rtp_audio_rtcp_packet_count: 0.variable_rtp_audio_rtcp_octet_count: 0..                      
#

And the get_account 1001

root@debian:~# cgr-console get_account cgrates.org 1001
{
  "Id": "*out:cgrates.org:1001",
  "BalanceMap": {
    "*monetary*out": [
      {
        "Uuid": "6cf69dac402710d5802696e7b446f913",
        "Value": 5.941,
        "ExpirationDate": "0001-01-01T00:00:00Z",
        "Weight": 10,
        "DestinationId": "*any",
        "RateSubject": "",
        "SharedGroup": ""
      }
    ]
  },
  "UnitCounters": [
    {
      "Direction": "*out",
      "BalanceType": "*monetary",
      "Balances": [
        {
          "Uuid": "",
          "Value": 10.507899999999914,
          "ExpirationDate": "0001-01-01T00:00:00Z",
          "Weight": 0,
          "DestinationId": "",
          "RateSubject": "",
          "SharedGroup": ""
        }
      ]
    }
  ],
  "ActionTriggers": [
    {
      "Id": "0597e97e40a55463806723780c8fba8b",
      "BalanceType": "*monetary",
      "Direction": "*out",
      "ThresholdType": "*min_balance",
      "ThresholdValue": 2,
      "DestinationId": "",
      "Weight": 10,
      "ActionsId": "LOG_WARNING",
      "Executed": false
    },
    {
      "Id": "f12bf1b2405938b080a0b2b3d8bd8e2b",
      "BalanceType": "*monetary",
      "Direction": "*out",
      "ThresholdType": "*max_balance",
      "ThresholdValue": 20,
      "DestinationId": "",
      "Weight": 10,
      "ActionsId": "LOG_WARNING",
      "Executed": false
    },
    {
      "Id": "b4f0649c40aaa104804ebd0f06b53af2",
      "BalanceType": "*monetary",
      "Direction": "*out",
      "ThresholdType": "*max_counter",
      "ThresholdValue": 5,
      "DestinationId": "FS_USERS",
      "Weight": 10,
      "ActionsId": "LOG_WARNING",
      "Executed": true
    }
  ],
  "Groups": null,
  "UserIds": null,
  "AllowNegative": false,
  "Disabled": false
}


get_account for 1002 is
root@debian:~# cgr-console get_account cgrates.org 1002
{
  "Id": "*out:cgrates.org:1002",
  "BalanceMap": {
    "*monetary*out": [
      {
        "Uuid": "6cf69dac402710d5802696e7b446f913",
        "Value": 9.4,
        "ExpirationDate": "0001-01-01T00:00:00Z",
        "Weight": 10,
        "DestinationId": "*any",
        "RateSubject": "",
        "SharedGroup": ""
      }
    ]
  },
  "UnitCounters": [
    {
      "Direction": "*out",
      "BalanceType": "*monetary",
      "Balances": [
        {
          "Uuid": "",
          "Value": 0.9000000000000001,
          "ExpirationDate": "0001-01-01T00:00:00Z",
          "Weight": 0,
          "DestinationId": "",
          "RateSubject": "",
          "SharedGroup": ""
        }
      ]
    }
  ],
  "ActionTriggers": [
    {
      "Id": "0597e97e40a55463806723780c8fba8b",
      "BalanceType": "*monetary",
      "Direction": "*out",
      "ThresholdType": "*min_balance",
      "ThresholdValue": 2,
      "DestinationId": "",
      "Weight": 10,
      "ActionsId": "LOG_WARNING",
      "Executed": false
    },
    {
      "Id": "f12bf1b2405938b080a0b2b3d8bd8e2b",
      "BalanceType": "*monetary",
      "Direction": "*out",
      "ThresholdType": "*max_balance",
      "ThresholdValue": 20,
      "DestinationId": "",
      "Weight": 10,
      "ActionsId": "LOG_WARNING",
      "Executed": false
    },
    {
      "Id": "b4f0649c40aaa104804ebd0f06b53af2",
      "BalanceType": "*monetary",
      "Direction": "*out",
      "ThresholdType": "*max_counter",
      "ThresholdValue": 5,
      "DestinationId": "FS_USERS",
      "Weight": 10,
      "ActionsId": "LOG_WARNING",
      "Executed": false
    }
  ],
  "Groups": null,
  "UserIds": null,
  "AllowNegative": false,
  "Disabled": false
}


Thank you again.
-Faruk



Faruk Ahmed


Dan Christian Bogos

unread,
Jul 14, 2014, 11:35:41 AM7/14/14
to cgr...@googlegroups.com
Hi Faruk,

I see two things:

1. No CHANNEL_ANSWER event in your trace (which is weird since it should happen no matter what). Are you sure you have captured all communication?
2. The balance of your 1001 is 5.941 and you have 10.5 units already spent (could be that debit work just fine just you need to get comfortable with them).

Can you please check balance after each call?

DanB

Faruk Ahmed

unread,
Jul 14, 2014, 6:30:09 PM7/14/14
to cgr...@googlegroups.com
Hi Dan, 

Here is what I did, I have installed the debian wheezy in virtualvox with bridged network. The Jitsi is in the host OS and the cgrates is in the guest OS (debian). The Jitsi is registering extension 1001 and 1002. I am making calls from 1001 to 1002 and vise versa. 

I saw the balance was debited too, but did not able to see it on the syslog as you showed in the youtube tutorial. Is there any other way to see that the rater is debiting the cost realtime, just for the hack of debugging.

I am trying to understand the flow of it, if you could help me. When 1001 or 1002 makes call, it goes through the dialplan. Does it get parked by cgrates and then gets forwarded to the destination ? Or how the dialplan and the cgrates is related ? 

Thank you   


Faruk Ahmed


Dan-Cristian Bogos

unread,
Jul 14, 2014, 6:36:44 PM7/14/14
to cgr...@googlegroups.com

Hi Faruk

Unfortunately the tutorial is from early times of CGRateS so not much to compare. The proof would be get account commands out of console. You need to imagine that we target real-time and every write to syslog is slowing down the processing. We have cut the logs as much as possible. We show errors only when the system does not behave not the viceversa.
In order to understand the call flow, please check this link:
http://cgrates.readthedocs.org/en/latest/freeswitch.html

Let me know your questions after.

DanB.

Faruk Ahmed

unread,
Jul 14, 2014, 7:38:01 PM7/14/14
to cgr...@googlegroups.com
Hi Dan, 

This time I keep pulling the get_account of the 1001 extensions and see the Value, YES it did the realtime debit and I am excited to see this. As I was not able to see the rater debug, I thought the rater is not debiting the balance. Thank you so much for your help.

My next step to understand the tariff structure (the csv) files.

Thank you, I will be back with tariff questions soon. 

Faruk Ahmed


Reply all
Reply to author
Forward
0 new messages