Best way to startup Kamailio / Cgrates

365 views
Skip to first unread message

Andrew Tan

unread,
Jan 24, 2016, 10:30:11 PM1/24/16
to CGRateS
Hi Dan, Seems like Cgrates keeps going down after some time. Currently it's installed on the same machine as Kamailio. What is the best way to auto start it? Not exactly too sure whats causing it too.

Andrew

DanB

unread,
Jan 25, 2016, 5:02:09 AM1/25/16
to cgr...@googlegroups.com
Hi Andrew,

Please open an issue on github (using latest master) since CGRateS is not allowed to panic out of nowhere.

You should be able to use just fine init script providing within the pkg folder (sources).

Please provide more info regarding the reason of crash.

Thanks,
DanB


On 25.01.2016 04:30, Andrew Tan wrote:
Hi Dan, Seems like Cgrates keeps going down after some time. Currently it's installed on the same machine as Kamailio. What is the best way to auto start it? Not exactly too sure whats causing it too.

Andrew
--
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/75a264e9-6f47-4859-b27b-f3bf71ea5549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Tan

unread,
Jan 26, 2016, 5:46:21 PM1/26/16
to CGRateS
Hi Dan, 

Tried to dig in to get more info on the crash but i didnt have anyluck. I went to /var/log/cgrates couldn't find anything.
I'm outputting syslog to some logging service maybe if it happens again now i have it index and searchable.

question on the cgrates.json configuration below:

What does it mean when it says reconnects 5? 


"sm_kamailio": {

182   "enabled": true,        // starts SessionManager service: <true|false>

183   "rater": "127.0.0.1:2013",      // address where to reach the Rater <""|internal|127.0.0.1:2013>

184   "cdrs": "internal",       // address where to reach CDR Server, empty to disable CDR capturing <""|internal|x.y.z.y:1234>

185   "create_cdr": true,     // create CDR out of events and sends them to CDRS component

186   "debit_interval": "60s",    // interval to perform debits on.

187   "min_call_duration": "0s",    // only authorize calls with allowed duration higher than this

188   "max_call_duration": "3h",    // maximum call duration a prepaid call can last

189   "connections":[         // instantiate connections to multiple Kamailio servers

190     {"evapi_addr": "127.0.0.1:8448", "reconnects": 5}

191   ]

192 },

Andrew Tan

unread,
Jan 26, 2016, 5:52:48 PM1/26/16
to CGRateS

Also, I'm not sure what highlighted below field does...

I just noticed when Kamailio is down after 3 minutes or so CGRates shutdown.

I guess this is the reason CGrates is down.



10 "general": {

 11   "http_skip_tls_verify": false,      // if enabled Http Client will accept any TLS certificate

 12   "rounding_decimals": 0,       // system level precision for floats

 13   "dbdata_encoding": "msgpack",     // encoding used to store object data in strings: <msgpack|json>

 14   "tpexport_dir": "/var/log/cgrates/tpe", // path towards export folder for offline Tariff Plans

 15   "default_reqtype": "*prepaid",      // default request type to consider when missing from requests: <""|*prepaid|*postpaid|*pseudoprepaid|*rated>

 16   "default_category": "call",       // default Type of Record to consider when missing from requests

 17   "default_tenant": "sipserver.com",    // default Tenant to consider when missing from requests

 18   "default_subject": "sipserver.com",     // default rating Subject to consider when missing from requests

 19   "default_timezone": "Local",      // default timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>

 20   "connect_attempts": 3,          // initial server connect attempts

 21   "response_cache_ttl": "3s",       // the life span of a cached response

 22   "reconnects": -1,           // number of retries in case of connection lost

 23   "internal_ttl": "5m",         // maximum duration to wait for internal connections before giving up

 24 },

 25 

DanB

unread,
Jan 27, 2016, 5:39:51 AM1/27/16
to cgr...@googlegroups.com
Hi Andrew,

Yes, CGRateS will go down based on your reconnects setting (eg: if no success after x reconnects, consider failure. You can configure that parameter on -1 for unlimited reconnects.

Will understand that CGRateS did not crash in your case, going voluntarily down due to loosing connection with OpenSIPS.

DanB

DanB

unread,
Jan 27, 2016, 5:40:57 AM1/27/16
to cgr...@googlegroups.com
Andrew,

Answers inline ...



On 26.01.2016 23:46, Andrew Tan wrote:
Hi Dan, 

Tried to dig in to get more info on the crash but i didnt have anyluck. I went to /var/log/cgrates couldn't find anything.
I'm outputting syslog to some logging service maybe if it happens again now i have it index and searchable.

question on the cgrates.json configuration below:

What does it mean when it says reconnects 5? 


"sm_kamailio": {

182   "enabled": true,        // starts SessionManager service: <true|false>

183   "rater": "127.0.0.1:2013",      // address where to reach the Rater <""|internal|127.0.0.1:2013>

184   "cdrs": "internal",       // address where to reach CDR Server, empty to disable CDR capturing <""|internal|x.y.z.y:1234>

185   "create_cdr": true,     // create CDR out of events and sends them to CDRS component

186   "debit_interval": "60s",    // interval to perform debits on.

187   "min_call_duration": "0s",    // only authorize calls with allowed duration higher than this

188   "max_call_duration": "3h",    // maximum call duration a prepaid call can last

189   "connections":[         // instantiate connections to multiple Kamailio servers

190     {"evapi_addr": "127.0.0.1:8448", "reconnects": 5}

Number of reconnects to evapi before considering system failure and giving up (implicit bringing it's services down).

DanB

191   ]

192 },



On Monday, January 25, 2016 at 2:02:09 AM UTC-8, DanB wrote:
Hi Andrew,

Please open an issue on github (using latest master) since CGRateS is not allowed to panic out of nowhere.

You should be able to use just fine init script providing within the pkg folder (sources).

Please provide more info regarding the reason of crash.

Thanks,
DanB

On 25.01.2016 04:30, Andrew Tan wrote:
Hi Dan, Seems like Cgrates keeps going down after some time. Currently it's installed on the same machine as Kamailio. What is the best way to auto start it? Not exactly too sure whats causing it too.

Andrew
--
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/75a264e9-6f47-4859-b27b-f3bf71ea5549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
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.

Andrew Tan

unread,
Jan 27, 2016, 12:50:58 PM1/27/16
to CGRateS
Thanks, obvious explanation! 

Cheers 
Andrew
Reply all
Reply to author
Forward
0 new messages