Browse code

presence(k): dynamic support for new event package

- patch by Aymeric Moizard
- events can be given as EVENT_OTHER, matching being done on string
value

Daniel-Constantin Mierla authored on 28/01/2010 11:06:07
Showing 3 changed files
... ...
@@ -350,7 +350,10 @@ pres_ev_t* search_event(event_t* event)
350 350
 
351 351
 	while(pres_ev)
352 352
 	{
353
-		if(pres_ev->evp->type== event->type)
353
+		if((pres_ev->evp->type== event->type && event->type!=EVENT_OTHER)
354
+			|| (pres_ev->evp->name.len== event->name.len &&
355
+				strncasecmp(pres_ev->evp->name.s,event->name.s,
356
+					pres_ev->evp->name.len)== 0))
354 357
 		{
355 358
 			if(event->params.list== NULL && pres_ev->evp->params.list== NULL)
356 359
 			{
... ...
@@ -325,10 +325,6 @@ int handle_publish(struct sip_msg* msg, char* sender_uri, char* str2)
325 325
 			reply_str= pu_400a_rpl;
326 326
 			goto error;
327 327
 		}
328
-		if(((event_t*)msg->event->parsed)->type == EVENT_OTHER)
329
-		{	
330
-			goto unsupported_event;
331
-		}
332 328
 	}
333 329
 	else
334 330
 		goto unsupported_event;
... ...
@@ -544,10 +544,6 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
544 544
 			reply_str= pu_400_rpl;
545 545
 			goto error;
546 546
 		}
547
-		if(((event_t*)msg->event->parsed)->type == EVENT_OTHER)
548
-		{	
549
-			goto bad_event;
550
-		}
551 547
 	}
552 548
 	else
553 549
 		goto bad_event;