[OpenSIPS-Devel] [Kamailio-Devel] pua callback

Schumann Sebastian Sebastian.Schumann at t-com.sk
Tue Oct 7 12:40:07 CEST 2008


Thanks Daniel, Anca and Klaus.

I tried the approach to register a callback already, however I was confused with the types, so I didn't succeed there.

I will try the approach with the ID, that I will create myself within the script. I think this is the most suitable for my case. 

Will come back to you if I have new results or more questions...

Sebastian 

PS: Klaus, thanks for hint with the new pua_dialog module, almost forgot to check that as I did work with branch but not trunk so far.

> -----Original Message-----
> From: Anca Vamanu [mailto:anca at voice-system.ro] 
> Sent: Monday, 06. October 2008 19:00
> To: Klaus Darilion
> Cc: Schumann Sebastian; devel at lists.kamailio.org; 
> devel at lists.opensips.org
> Subject: Re: [OpenSIPS-Devel] [Kamailio-Devel] pua callback
> 
> Hi Sebastian,
> 
> As Klaus said, you should not keep the etag to ensure that 
> the state is updated, but provide the same id and pua module 
> will take care of that.
> If you however, do want get the etag or the expires from the 
> answer in your module, you have to register a callback in pua 
> module to be called when the reply for the message you 
> triggered is received.
> 
> For this, you have to register the callback in mod_init, as 
> it is done in modules/pua_mi/pua_mi.c file:
> 
>     if(pua.register_puacb(SCRIPT_PUBLISH, scr_publ_rpl_cback, 
> NULL)< 0)
>     {
>         LM_ERR("Could not register callback\n");
>         return -1;
>     }   
> where SCRIPT_PUBLISH should be a new type of source 
> generating messages, that has to be defined in pua module.
> And then define the scr_publ_rpl_callback which has the prototype:
> int scr_publ_rpl_cback( ua_pres_t* hentity, struct sip_msg* 
> reply); The first parameter is a structure with infos about 
> the presentity and the second is the reply message.
> 
> regards,
> Anca Vamanu
> 
> 
> Klaus Darilion wrote:
> > Hi Sebastian!
> >
> > In the presence_dialoginfo module I do not care about the etag. The 
> > pua module stores the etag itself and reuses it for further 
> presence requests.
> >
> > (I think it is based on the publ->id which should be constant for 
> > "in-dialog" requests. Further, the type must be set to the 
> update type:
> > publ->flag|= UPDATE_TYPE;)
> >
> > regards
> > klaus
> >
> > Schumann Sebastian schrieb:
> >   
> >> Dear all
> >>  
> >> I wrote a module using the pua module api to send presence 
> messages 
> >> directly from the script and it all works fine. I have 
> only problems 
> >> to use the ETag from the answer, I can somehow not process 
> the answer 
> >> at all. I tried to look at pua_mi and other pua modules but cannot 
> >> see any light there how to process the answer. I know pua callback 
> >> does it but do not know how, I am lost within the structures.
> >>  
> >> It is important though because otherwise if a publish is 
> sent and the 
> >> state is updated, there is no acutal update but two 
> presence states 
> >> from one client.
> >>  
> >> Can someone (Anca?) help me and provide some more info about the 
> >> proper use of PUA to process the answer and E-Tag 
> respectively properly?
> >>  
> >> Thanks a lot!
> >>  
> >> Sebastian
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> ---
> >>
> >> _______________________________________________
> >> Devel mailing list
> >> Devel at lists.kamailio.org
> >> http://lists.kamailio.org/cgi-bin/mailman/listinfo/devel
> >>     
> >
> > _______________________________________________
> > Devel mailing list
> > Devel at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
> >
> >   
> 
> 



More information about the Devel mailing list