[OpenSER-Devel] Going through all branches with the TM module

Ardjan Zwartjes a.zwartjes at telecats.nl
Mon Jul 2 15:58:18 CEST 2007


Dear developers,

I'm currently developing some OpenSER modules which will log the status
of all outgoing branches in the failure route. Based on what I could see
in other modules I figured out that something like this would do that:

t=tm.t_gett();
for( branch_counter=t->first_branch ;
branch_counter<(t->nr_of_outgoings+t->first_branch); branch_counter++)
{
	//Log everything.
}

For the logging I get most of the data from
t->uac[branch_counter].reply, and most of the time this works fine. Only
sometimes I get segfaults when accessing the reply structure. I check if
the pointer to this struct isn't NULL or FAKED_REPLY, but still my
module crashes whenever a 408 is generated by a timeout. 

So my question is: Am I doing something wrong, how can I check if the
reply pointer will be valid? Or is this a bug in the TM module and
should it have set the pointer to a usable value? Thanks in advance for
the information.

Kind regards,
Ardjan Zwartjes.



More information about the Devel mailing list