[SR-Users] Event when acc is written?

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 25 16:06:45 CET 2017


Hello,


dispatcher module executes some event routes -- it has a wrapper function:


https://github.com/kamailio/kamailio/blob/master/src/modules/dispatcher/dispatch.c#L2261


For acc should be simpler, because the sip request should be there, used
by acc to get the attributes, so no need to make a fake one. Should be a
pice of code like next one plugged in acc_onreply() function from acc
module:


    rt = route_lookup(&event_rt, "acc:record-stored");
    if(rt < 0 || event_rt.rlist[rt] == NULL) {
        LM_DBG("event route does not exist");
        return;
    }
    backup_rt = get_route_type();
    set_route_type(REQUEST_ROUTE);
    init_run_actions_ctx(&ctx);
    run_top_route(event_rt.rlist[rt], preq, 0);
    set_route_type(backup_rt);

That's based on a very quick look in the code, you may need to tune a
bit (and define some vars, add includes, etc.).

Cheers,
Daniel



On 25/01/2017 15:45, Tobias wrote:
>
> Hi Daniel,
>
>
> Thanks. Can you point me to a good example of how this is implemented
> in another module, perhaps I could then add it myself to acc?
>
>
> /Tobias
>
>
> ------------------------------------------------------------------------
> *From:* Daniel-Constantin Mierla <miconda at gmail.com>
> *Sent:* Wednesday, January 25, 2017 3:20 PM
> *To:* Tobias; Kamailio (SER) - Users Mailing List
> *Subject:* Re: [SR-Users] Event when acc is written?
>  
>
> Hello,
>
>
> On 25/01/2017 09:44, Tobias wrote:
>>
>> Hi Daniel,
>>
>>
>> Thanks for your reply.
>>
>>
>> Disregarding the MySQL ID, would it be possible to get the callid of
>> the call back from the acc module once a write has been made?
>>
> to my knowledge, there is no cfg event_route executed at that moment.
> It should not be something complex to add, but requires c coding in
> acc module.
>
> Cheers,
> Daniel
> -- 
> Daniel-Constantin Mierla
> www.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - www.asipto.com
> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
> Kamailio World - Our site will be launched soon
> <http://www.kamailioworld.com/>
> www.kamailioworld.com
> the 5th edition May 8-10, 2017 - Berlin, Germany. Website of the event
> and more details will be available very soon!
>
>
> Daniel-Constantin Mierla | LinkedIn <http://www.linkedin.com/in/miconda>
> www.linkedin.com
> View Daniel-Constantin Mierla’s professional profile on LinkedIn.
> LinkedIn is the world's largest business network, helping
> professionals like Daniel-Constantin Mierla discover inside
> connections to recommended job candidates, industry experts, and
> business partners.
>
>
> miconda (@miconda) | Twitter <http://www.twitter.com/miconda>
> www.twitter.com
> The latest Tweets from miconda (@miconda). Co-founder and leader of
> Kamailio SIP Server project (former OpenSER). C Dev. Open Source RTC
> advocate. SIP, VoIP, VoLTE and WebRTC consultancy at Asipto. Berlin,
> Germany
>
>

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Mar 6-8 (Europe) and Mar 20-22 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170125/38db4bb3/attachment.html>


More information about the sr-users mailing list