ARI ChannelVarset event sent too frequently for Bridged Call

Hi,

I am using ARI to connect calls by putting them into bridge, this is how I connect them:

  1. Call initiates with Caller A
  2. Create Bridge and add A to Bridge
  3. Create outgoing channel for B
  4. Add Channel B to Bridge
  5. Dial channel B
  6. When B picks up (I use Ari Dial Event to detect it) answer A and B

Everything works as intended my question is Asterisk is sending same ChannelVarset event for both channels too many times e.g.

I get the following event around 15+ in a burst with Timestamp difference only after the channel has entered the bridge.

<— Sending ARI event to 127.0.0.1 —>

{
“variable”: “BRIDGEPEER”,
“value”: “PJSIP/sip-proxy”,
“type”: “ChannelVarset”,
“timestamp”: “2018-07-11T12:10:07.979+0000”,
“channel”: {
“id”: “1531310980.283”,
“name”: “PJSIP/sip-gateway”,
“state”: “Up”,
“caller”: {
“name”: “”,
“number”: “”
},
“connected”: {
“name”: “”,
“number”: “*"
},
“accountcode”: “”,
“dialplan”: {
“context”: “forbidden”,
“exten”: “s”,
“priority”: 1
},
“creationtime”: “2018-07-11T12:09:40.846+0000”,
“language”: “en”
},
“asterisk_id”: “”,
“application”: “testapp”
}
<— Sending ARI event to 127.0.0.1 —>
{
“variable”: “BRIDGEPEER”,
“value”: “PJSIP/sip-proxy”,
“type”: “ChannelVarset”,
“timestamp”: “2018-07-11T12:10:08.019+0000”,
“channel”: {
“id”: “1531310980.283”,
“name”: “PJSIP/sip-gateway”,
“state”: “Up”,
“caller”: {
“name”: “”,
“number”: “”
},
“connected”: {
“name”: “”,
“number”: "

},
“accountcode”: “”,
“dialplan”: {
“context”: “forbidden”,
“exten”: “s”,
“priority”: 1
},
“creationtime”: “2018-07-11T12:09:40.846+0000”,
“language”: “en”
},
“asterisk_id”: “”,
“application”: “testapp”
}

Can anyone explain why asterisk needs to set BRIDGEPEER variable on the channel so many times in such a short time span ?

Note: The variable “BRIDGEPVTCALLID” has the same behavior as well

-Adnan

I’d suggest using the asterisk-dev mailing list[1] but it may just be a case where things haven’t been optimized or targeted to reduce that.

[1] http://lists.digium.com/mailman/listinfo/asterisk-dev