CGRMaxSessionTime Not capture by Asterisk

25 views
Skip to first unread message

Yohai A

unread,
May 9, 2018, 3:47:04 AM5/9/18
to CGRateS

Hi,

We integrate CGRates with Asterisk via AIR.
We followed the tutorial and examples.

The problem is that asterisk doesn't capture the CGRMaxSessionTime value.

The ngrep log:
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_tenant=num2.il",
    "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.
Server: Asterisk/15.3.0.
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.
Server: Asterisk/15.3.0.
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.
Server: Asterisk/15.3.0.
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"
}
##

Regards,
Yohai

DanB

unread,
May 9, 2018, 6:49:29 AM5/9/18
to cgr...@googlegroups.com
Hi Yohai,

Do you have this in your dialplan:
https://github.com/cgrates/cgrates/blob/master/data/tutorials/asterisk_
ari/asterisk/etc/asterisk/extensions.conf#L6
?

DanB
> --
> 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/a783133c-4c9e-48b4-904e-0c567f5c8d7a%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

Yohai A

unread,
May 9, 2018, 8:23:52 AM5/9/18
to CGRateS
Hi Dan,

Yes, i have it.
This is my the part from extension:
exten => _X.,n,Set(CGRMaxSessionTime=0); use it to disconnect automatically the call if CGRateS is not active
exten => _X.,n,DumpChan()
exten => _X.,n,Stasis(cgrates_auth,cgr_category=voice,cgr_reqtype=*prepaid,cgr_supplier=supplier1,cgr_tenant=num2.il,cgr_account=972${Caller:1},cgr_destination=972${Called:1},cgr_tor=voice,cgr_subject=972${Called:1}) ;
exten => _X.,n,Verbose(CGRMaxSessionTime:${CGRMaxSessionTime} --- ${value})


Yohai

DanB

unread,
May 9, 2018, 8:27:33 AM5/9/18
to cgr...@googlegroups.com
Yohai,

OK, so you don't see it in your channel variables or complaining that
the call is not being disconnected based on it?

DanB
> --
> 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/bd04505b-259a-411a-bf58-2fca942cf1ec%40googlegroups.com

Yohai A

unread,
May 9, 2018, 9:58:38 AM5/9/18
to CGRateS
Hi Dan,

I don't see it on channel variables dump.

can it be because the value in the body is not json?

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

Regards,
Yohai

On Wednesday, May 9, 2018 at 10:47:04 AM UTC+3, Yohai A wrote:

DanB

unread,
May 9, 2018, 10:01:24 AM5/9/18
to cgr...@googlegroups.com
Yohai,

If a normal post, it does not need to be JSON. Which version of
Asterisk are you using? Quite some time since we have tested Asterisk
TBH. It is however planned in the next days ...

DanB
> --
> 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/d403e6b9-1fe5-48c0-9af5-a6a2c6595c9d%40googlegroups.com

Yohai Allouche

unread,
May 9, 2018, 10:36:19 AM5/9/18
to cgr...@googlegroups.com
Hi,

We are using 15.3

Yohai


> 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/d403e6b9-1fe5-48c0-9af5-a6a2c6595c9d%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+unsubscribe@googlegroups.com.

To post to this group, send email to cgr...@googlegroups.com.

DanB

unread,
May 9, 2018, 10:37:51 AM5/9/18
to cgr...@googlegroups.com
Yohai,

OK, please open an issue on github regarding this and we should close
it as soon as we manage to reproduce/fix.

Thanks for your efforts!

DanB
> > > send an email to cgrates+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages