[Freeswitch-users] [Issue with setting variable while bridge/transfer]

Giovanni Maruzzelli gmaruzz at gmail.com
Wed Jan 1 14:54:52 UTC 2020

you have probably race conditions

eg, more than one call modify same counter

maybe you want to keep a uniqe counter for each callid, and then sum them
up ?

just first thoughts, maybe completely wrong

On Wed, Jan 1, 2020 at 3:17 PM Bilal Abbasi <bilaln018 at gmail.com> wrote:

> Hi Users,
> I have a switch where people are calling and they press 1 to get
> transferred to client's DID.
> I need to have stats for live total calls on my switch along with calls
> that are transferred(realtime stats).
> I am doing following commands to get the live total calls.(basically
> increasing variable ${CampaignId}_live on getting call and on hangup i
> decrement that variable).
> <action application="set" data="ignore=${memcache(increment
> ${CampaignId}_live 1)}"/>
> <action application="set" data="api_hangup_hook=memcache decrement
> ${CampaignId}_live 1"/>
> I am doing this while i transfer the calls to client's number(basically
> increasing variable ${CampaignId}_transfer on when somebody presses
> transfer button and on hangup i decrement that variable).
> <action application="bridge" data="{api_hangup_hook='memcache decrement
> ${CampaignId}_transfer 1 both',ignore='${memcache(increment
> ${CampaignId}_transfer
> 1)}'transfer_trigger=1}sofia/external/${TransferTo}"/>
> Now i have live calls stats coming correctly.
> But in case of transfer calls, when i have low number of calls(like 3-4
> calls) it works good, but when i have 50-60 calls the stats are not
> presented correctly(it does not increase/decrease memcache variable).
> Can someone guide me how to do this in a better way?, or what mistake i am
> making in doing it.
> Regards
> Abbasi
> _________________________________________________________________________
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
> Join our online community to chat in real time
> https://signalwire.community
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com


Giovanni Maruzzelli
cell: +39 347 266 56 18
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200101/3e8b0bc8/attachment-0001.html>

More information about the FreeSWITCH-users mailing list