We integrate CGRates with Asterisk via AIR.
We followed the tutorial and examples.
The problem is that asterisk doesn't capture the CGRMaxSessionTime value.
T 2018/05/09 10:07:41.623833 192.168.XXX.ZZZ:8088 -> 192.168.XXX.YYY:37714 [AP]
.~.P{
"type": "StasisStart",
"timestamp": "2018-05-09T10:08:07.926+0300",
"args": [
"cgr_category=voice",
"cgr_reqtype=*prepaid",
"cgr_supplier=supplier1",
"cgr_account=972ZZXXXXXX",
"cgr_destination=972ZZXXXXXXX",
"cgr_tor=voice",
"cgr_subject=972ZZXXXXXXX"
],
"channel": {
"id": "1525849685.761",
"name": "SIP/CELLACT_GB_1-00000115",
"state": "Ring",
"caller": {
"name": "ABC EFG",
"number": "ZZXXXXXX"
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "shadow_1",
"exten": "0ZZXXXXXX",
"priority": 49
},
"creationtime": "2018-05-09T10:08:05.716+0300",
"language": "he"
},
"asterisk_id": "00:50:56:8a:56:f4",
"application": "cgrates_auth"
}
#####
T 2018/05/09 10:07:41.626329 192.168.XXX.YYY:37954 -> 192.168.XXX.ZZZ:8088 [AP]
POST /ari/applications/cgrates_auth/subscription?eventSource=channel:1525849685.761 HTTP/1.1.
Host: 192.168.XXX.ZZZ:8088.
User-Agent: CGRateS 0.9.1~rc8.
Content-Length: 0.
Authorization: Basic Y2dyYXRlczpDR1JhdGVTLm9yZw==.
Accept-Encoding: gzip.
.
##
T 2018/05/09 10:07:41.627171 192.168.XXX.ZZZ:8088 -> 192.168.XXX.YYY:37954 [AP]
HTTP/1.1 200 OK.
Date: Wed, 09 May 2018 07:08:07 GMT.
Cache-Control: no-cache, no-store.
Content-type: application/json.
Content-Length: 137.
.
{
"name": "cgrates_auth",
"channel_ids": [
"1525849685.761"
],
"bridge_ids": [],
"endpoint_ids": [],
"device_names": []
}
##
T 2018/05/09 10:07:41.643898 192.168.XXX.YYY:37954 -> 192.168.XXX.ZZZ:8088 [AP]
POST /ari/channels/1525849685.761/variable?variable=CGRMaxSessionTime HTTP/1.1.
Host: 192.168.XXX.ZZZ:8088.
User-Agent: CGRateS 0.9.1~rc8.
Content-Length: 13.
Authorization: Basic Y2dyYXRlczpDR1JhdGVTLm9yZw==.
Accept-Encoding: gzip.
.
value=3174000
#
T 2018/05/09 10:07:41.644702 192.168.XXX.ZZZ:8088 -> 192.168.XXX.YYY:37954 [AP]
HTTP/1.1 204 No Content.
Date: Wed, 09 May 2018 07:08:07 GMT.
Cache-Control: no-cache, no-store.
Content-Length: 0.
.
#
T 2018/05/09 10:07:41.645009 192.168.XXX.YYY:37954 -> 192.168.XXX.ZZZ:8088 [AP]
POST /ari/channels/1525849685.761/continue HTTP/1.1.
Host: 192.168.XXX.ZZZ:8088.
User-Agent: CGRateS 0.9.1~rc8.
Content-Length: 0.
Authorization: Basic Y2dyYXRlczpDR1JhdGVTLm9yZw==.
Accept-Encoding: gzip.
.
#
T 2018/05/09 10:07:41.645414 192.168.XXX.ZZZ:8088 -> 192.168.XXX.YYY:37954 [AP]
HTTP/1.1 204 No Content.
Date: Wed, 09 May 2018 07:08:07 GMT.
Cache-Control: no-cache, no-store.
Content-Length: 0.
.
##
T 2018/05/09 10:07:41.824346 192.168.XXX.YYY:8088 -> 192.168.XXX.ZZZ:37714 [AP]
.~..{
"variable": "CGRMaxSessionTime",
"value": "",
"type": "ChannelVarset",
"timestamp": "2018-05-09T10:08:08.126+0300",
"channel": {
"id": "1525849685.761",
"name": "SIP/CELLACT_GB_1-00000115",
"state": "Ring",
"caller": {
"name": "ABC EFG",
"number": "ZZXXXXXX"
},
"connected": {
"name": "",
"number": ""
},
"accountcode": "",
"dialplan": {
"context": "shadow_1",
"exten": "0ZZXXXXXX",
"priority": 49
},
"creationtime": "2018-05-09T10:08:05.716+0300",
"language": "he"
},
"asterisk_id": "00:50:56:8a:56:f4",
"application": "cgrates_auth"
}
##