[OpenSIPS-Devel] [ opensips-Bugs-2820717 ] event_parse parse first parameter only

SourceForge.net noreply at sourceforge.net
Wed Jul 15 11:30:18 CEST 2009


Bugs item #2820717, was opened at 2009-07-13 14:25
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2820717&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: trunk
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Tiberius DULUMAN (tiberius_d)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: event_parse parse first parameter only

Initial Comment:
There is a bug in function "int event_parser(char* _s, int _l, event_t* _e)" in parse_event.c. The call
end= skip_token(params_str.s, tmp.len- _e->text.len- 1);
is wrong. This makes the function to parse first parameter only of the Event header. I have replaced it with:
end= tmp.s + tmp.len;
and it works fine now.

----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-07-15 12:30

Message:
OK - got you. First I though is it about the event name and not about the
event parameters.
I uploaded the patch on SVN 1.5 and trunk.

Thanks and regards,
Bogdan

----------------------------------------------------------------------

Comment By: Tiberius DULUMAN (tiberius_d)
Date: 2009-07-15 10:04

Message:
I am calling this function from a module that I have written. But you may
test it with this values:

Event: presence;id=xxx;p=xxx
Event: dialog;call-id=xxx;to-tag=xxx;from-tag=xxx

Here are more details:
99: end = skip_token(tmp.s, tmp.len);   <--- end is set after event name (
so end points on ";" after "presence"
130: params_str.s= end+1;  <--- params_str.s is set to point on first
parameter ( so it points to "id=123;p=abc" )
131: end= skip_token(params_str.s, tmp.len- _e->text.len- 1);  <--- end is
set after first parameter
133: params_str.len= end- params_str.s;    <--- now, params_str contains
"id=123"
135: parse_params(&params_str, [...]    <--- parse only first parameter

Regards,
Tiberius


----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-07-14 19:16

Message:
Not sure how correct is....the skip_token() function exacts the first token
to be considered as event name (without params or separator )

Could you post an example of the Event header you are dealing with ?

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2820717&group_id=232389



More information about the Devel mailing list