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

David Villasmil david.villasmil.work at gmail.com
Thu Jan 2 18:31:08 UTC 2020


Have you tried setting separate variables? I.e: increase  “conn” by 1 when
connected and increase “disc” by 1 when disconnected.

This would help you see if race conditions are messing it up. To get the
actual connected you’d simply subtract.

On Thu, 2 Jan 2020 at 18:45, Bilal Abbasi <bilaln018 at gmail.com> wrote:

> Can anyone help me out with this please.
>
> Regards
> Abbasi
>
> On Wed, 1 Jan 2020 at 8:45 PM, Bilal Abbasi <bilaln018 at gmail.com> wrote:
>
>> Hi Marruzelli,
>> I am doing exactly same for live calls stats, and those are working good.
>> Its only issue when i do that on transfer calls.
>> Its not even 10CPS calls.
>>
>>
>> Regards
>> Abbasi
>>
>> On Wed, 1 Jan 2020 at 8:24 PM, Giovanni Maruzzelli <gmaruzz at gmail.com>
>> wrote:
>>
>>> 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
>>>
>>>
>>>
>>> --
>>> Sincerely,
>>>
>>> Giovanni Maruzzelli
>>> OpenTelecom.IT
>>> cell: +39 347 266 56 18
>>>
>>> _________________________________________________________________________
>>>
>>> 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
>>
>> _________________________________________________________________________
>
> 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

-- 
Regards,

David Villasmil
email: david.villasmil.work at gmail.com
phone: +34669448337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200102/be734352/attachment-0001.html>


More information about the FreeSWITCH-users mailing list