[OpenSIPS-Users] [dialog] Can't fetch data in 200 reply route of BYE

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Mar 9 09:36:49 CET 2010


Hi Liuf,

dlg_onreq() function is intended to be called/used only for initial 
requests (for the INVITEs creating a dialog).

So, this function is not intended to be used for BYE request - the BYE 
is handled via the dlg_onroute() function which is used for all 
sequential requests.

If you find any issues is some parts of the code, please let me know and 
I will take care.

Regards,
Bogdan

liuf wrote:
> When I used fetch_dlg_value to get data in 200 reply route of BYE, it always
> empty.
>
> I read some source about dialog module, I had discovered some possible
> mistakes in function dlg_onreq() (file dlg_handles.c)(svn rev
> 6658)(2010-03-08)
>
> When opensips receive 'BYE', current_dlg_pointer must be not null, and
> current_dlg_pointer had been initiated, so this function will be return
> before 't->dialog_ctx = (void*)current_dlg_pointer;' be exec. So in 200
> reply of BYE, can't get dialog pointer.
>
> I'm not sure this problem really exits? Would you please confirm it?
>
> function dlg_onreq() (svn rev 6658 2010-03-08)
> ==============================================
> void dlg_onreq(struct cell* t, int type, struct tmcb_params *param)
> {
> 	/* is the dialog already created? */
> 	if (current_dlg_pointer!=NULL) {
> 		/* new, un-initialized dialog ? */
> 		if ( current_dlg_pointer->flags & DLG_FLAG_ISINIT )
> 			return;
>
> 		/* dialog was previously created by create_dialog() 
> 		   -> just do the last settings */
> 		run_create_callbacks( current_dlg_pointer, param->req);
>
> 		current_dlg_pointer->lifetime = get_dlg_timeout(param->req);
>
> 		if (param->req->flags&bye_on_timeout_flag)
> 			current_dlg_pointer->flags |= DLG_FLAG_BYEONTIMEOUT;
>
> 		t->dialog_ctx = (void*)current_dlg_pointer;
>
> 		/* dialog is fully initialized */
> 		current_dlg_pointer->flags |= DLG_FLAG_ISINIT;
> 	} else {
>  ......
> ========================================================
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list