Module: sip-router
Branch: master
Commit: 147e776d7a93388711191d208a7a3a107286f96d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=147e776…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Jan 28 12:06:07 2010 +0100
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
---
modules_k/presence/event_list.c | 5 ++++-
modules_k/presence/publish.c | 4 ----
modules_k/presence/subscribe.c | 4 ----
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/modules_k/presence/event_list.c b/modules_k/presence/event_list.c
index 1ccf39b..2ffdfba 100644
--- a/modules_k/presence/event_list.c
+++ b/modules_k/presence/event_list.c
@@ -350,7 +350,10 @@ pres_ev_t* search_event(event_t* event)
while(pres_ev)
{
- if(pres_ev->evp->type== event->type)
+ if((pres_ev->evp->type== event->type && event->type!=EVENT_OTHER)
+ || (pres_ev->evp->name.len== event->name.len &&
+ strncasecmp(pres_ev->evp->name.s,event->name.s,
+ pres_ev->evp->name.len)== 0))
{
if(event->params.list== NULL && pres_ev->evp->params.list== NULL)
{
diff --git a/modules_k/presence/publish.c b/modules_k/presence/publish.c
index a329433..05e6b15 100644
--- a/modules_k/presence/publish.c
+++ b/modules_k/presence/publish.c
@@ -325,10 +325,6 @@ int handle_publish(struct sip_msg* msg, char* sender_uri, char*
str2)
reply_str= pu_400a_rpl;
goto error;
}
- if(((event_t*)msg->event->parsed)->type == EVENT_OTHER)
- {
- goto unsupported_event;
- }
}
else
goto unsupported_event;
diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
index 6ea70ae..2fa38e1 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -544,10 +544,6 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
reply_str= pu_400_rpl;
goto error;
}
- if(((event_t*)msg->event->parsed)->type == EVENT_OTHER)
- {
- goto bad_event;
- }
}
else
goto bad_event;