[Freeswitch-users] FS -How to identify the A-leg or B-leg inside the source code

fieldpeak fieldpeak at gmail.com
Mon Oct 24 12:40:22 MSD 2011


Hi Avi,

It works well, thanks for your kindly information.

BR,
Charles

2011/10/17 fieldpeak <fieldpeak at gmail.com>

> Hi Avi,
>
> Thanks your valuable info, and i will try later, Thanks.
>
> BR,
> Charles
>
>
> 2011/10/16 Avi Marcus <avi at avimarcus.net>
>
>> Looking at the a_ prefix from mod_xml_cdr.c, it seems like it's this:
>>>
>>> is_b = channel && switch_channel_get_originator_caller_profile(channel);
>>
>>
>> Feel free to check freeswitch/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
>>
>> -Avi
>>
>>
>> On Sun, Oct 16, 2011 at 5:41 AM, fieldpeak <fieldpeak at gmail.com> wrote:
>>
>>> Hi Friends,
>>>
>>> i'm using mod_nibblebill for billing on FS, i bundled event processing
>>> fucntions when status change,
>>> e.g. /* on_routing */ check_billing_before_routing,
>>> and * on_hangup */ process_hangup, as below,
>>> however, i found it excuted the processing function on both A-leg and
>>> B-leg, what i want is that either only A-leg or only B-leg (i can
>>> select by coding), how can i realize it?
>>>
>>> P.S. is it possible that i identify the Legs (A or B) inside the
>>> processing function (e.g. check_billing_before_routing,) by intput
>>> parameter *sessionsession?
>>>
>>>
>>> source codes as below,
>>>
>>> switch_state_handler_table_t nibble_state_handler = {
>>>        /* on_init */ NULL,
>>>        /* on_routing */ check_billing_before_routing, /* Need to add a
>>> check
>>> here for anything in their account before routing */
>>>        /* on_execute */ sched_billing,         /* Turn on heartbeat for
>>> this
>>> session and do an initial account check */
>>>        /* on_hangup */ process_hangup,         /* On hangup - most
>>> important place
>>> to go bill */
>>>        /* on_exch_media */ NULL,
>>>        /* on_soft_exec */ NULL,
>>>        /* on_consume_med */ NULL,
>>>        /* on_hibernate */ NULL,
>>>        /* on_reset */ NULL,
>>>        /* on_park */ NULL,
>>>        /* on_reporting */ NULL,
>>>        /* on_destroy */ NULL
>>> };
>>>
>>>
>>> static switch_status_t
>>> check_billing_before_routing(switch_core_session_t *session)
>>> {
>>>        //is it possible to identify the legs (A or B) here?
>>>        ...
>>> }
>>>
>>>        static switch_status_t process_hangup(switch_core_session_t
>>> *session)
>>> {
>>>        ...
>>> }
>>>
>>> BR,
>>> Charles
>>>
>>>
>>> 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
>>> http://www.freeswitch.org
>>>
>>
>>
>>
>> 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
>> http://www.freeswitch.org
>>
>>
>
>
> --
> Regards,
> Charles
>
>


-- 
Regards,
Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111024/ecd1f57f/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list