[Kamailio-Users] presence module, events

toly hippo_big at hotmail.com
Mon Oct 13 23:42:32 CEST 2008


Greetings,
This is a question to the author: bogdan_iancu, but if anybody can answer,
I'd appreciate it.
Softphone client is Bria.

Here is publish event from ngrep

PUBLISH sip:tolyp at webley SIP/2.0.
Via: SIP/2.0/TCP 10.50.1.101:45464;branch=z9hG4bK-

T 2008/10/13 16:15:38.621949 10.50.1.101:1572 -> 10.50.4.40:5070 [AP]
d8754z-697cf1172b7bf515-1---d8754z-;rport.
Max-Forwards: 70.
Contact: <sip:tolyp at 10.50.1.101:1572;transport=TCP>.
To: "tolyp"<sip:tolyp at webley>.
From: "tolyp"<sip:tolyp at webley>;tag=ca65f37d.
Call-ID: YmFlNjUxMzEwM2Q4Nzk0MWRhZGUxZmQwMDA5NmE4Nzc..
CSeq: 1 PUBLISH.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO.
Content-Type: application/pidf+xml.
User-Agent: Bria release 2.4 stamp 49274.
Event: presence.
Content-Length: 441.
.
<?xml version='1.0' encoding='UTF-8'?><presence
xmlns='urn:ietf:params:xml:ns:pidf'
xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'
xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid'
xmlns:c='urn:ietf:params:xml:ns:pidf:cipid'
xmlns:lt='urn:ietf:params:xml:ns:location-type'
entity='sip:tolyp at webley'><tuple
id='t5a055764'><status><basic>open</basic></status></tuple><dm:person
id='p5e347748'><dm:note>Available</dm:note></dm:person></presence>

Here is the code from parser/parse_event.c

	if ((_e->text.len == PRES_STR_LEN) && 
	    !strncasecmp(PRES_STR, tmp.s, _e->text.len)) {
		_e->parsed = EVENT_PRESENCE;
	} else if ((_e->text.len == PRES_XCAP_CHANGE_STR_LEN) && 
		   !strncasecmp(PRES_XCAP_CHANGE_STR, tmp.s, _e->text.len)) {
		_e->parsed = EVENT_XCAP_CHANGE;
	} else if ((_e->text.len == PRES_WINFO_STR_LEN) && 
		   !strncasecmp(PRES_WINFO_STR, tmp.s, _e->text.len)) {
		_e->parsed = EVENT_PRESENCE_WINFO;
	} else if ((_e->text.len == PRES_SIP_PROFILE_STR_LEN) && 
		   !strncasecmp(PRES_SIP_PROFILE_STR, tmp.s, _e->text.len)) {
		_e->parsed = EVENT_SIP_PROFILE;
	} else if ((_e->text.len == DIALOG_STR_LEN) && 
		   !strncasecmp(DIALOG_STR, tmp.s, _e->text.len)) {
		_e->parsed = EVENT_DIALOG;
	} else if ((_e->text.len == MWI_STR_LEN) && 
		   !strncasecmp(MWI_STR, tmp.s, _e->text.len)) {
		_e->parsed = EVENT_MWI;
	} else {
		_e->parsed = EVENT_OTHER;
	}
	if( (*end)== ';')
	{
		str params_str;
		params_str.s= end+1;
		end= skip_token(params_str.s, tmp.len- _e->text.len- 1);
		
		params_str.len= end- params_str.s;

		if (parse_params(&params_str, CLASS_ANY, &phooks, &_e->params)<0)
			return -1;
	}
	else
		_e->params= NULL;

It detects presence event correctly, but then if( (*end)== ';') does not
find any semicolon
and here is the result:
10/13 16:34:57 13030 err ERROR:presence:handle_publish: <publish.c: 508>
Missing or unsupported event header field value
10/13 16:34:57 13030 err ERROR:presence:handle_publish: <publish.c: 511>       
event=[presence]

What semicolon it is looking? If I do (*end)== ' ') it still can't parse. Is
Bria message has incorrect format?
What was the format of message the parser was written for?

Thanks a lot,
Toly


-- 
View this message in context: http://www.nabble.com/presence-module%2C-events-tp19963494p19963494.html
Sent from the OpenSER Users Mailing List mailing list archive at Nabble.com.





More information about the Users mailing list