@tao-communications commented on this pull request.
+ if (kazoo_route_no>=0) {
sprintf(buffer, "kazoo:consumer-event-%.*s-%.*s",ev_category.len, ev_category.s,
ev_name.len, ev_name.s);
- for (p=buffer ; *p; ++p) *p = tolower(*p);
- for (p=buffer ; *p; ++p) if(*p == '_') *p = '-';
- if(kz_amqp_consumer_fire_event(buffer) != 0) {
- sprintf(buffer, "kazoo:consumer-event-%.*s",ev_category.len,
ev_category.s);
for (p=buffer ; *p; ++p) *p = tolower(*p);
for (p=buffer ; *p; ++p) if(*p == '_') *p = '-';
if(kz_amqp_consumer_fire_event(buffer) != 0) {
- sprintf(buffer, "kazoo:consumer-event-%s-%s", key, subkey);
+ sprintf(buffer, "kazoo:consumer-event-%.*s",ev_category.len,
ev_category.s);
for (p=buffer ; *p; ++p) *p = tolower(*p);
for (p=buffer ; *p; ++p) if(*p == '_') *p = '-';
if(kz_amqp_consumer_fire_event(buffer) != 0) {
- sprintf(buffer, "kazoo:consumer-event-%s", key);
+ sprintf(buffer, "kazoo:consumer-event-%s-%s", key, subkey);
for (p=buffer ; *p; ++p) *p = tolower(*p);
for (p=buffer ; *p; ++p) if(*p == '_') *p = '-';
- if(kz_amqp_consumer_fire_event(buffer) != 0) {
- sprintf(buffer, "kazoo:consumer-event");
- if(kz_amqp_consumer_fire_event(buffer) != 0) {
- LM_ERR("kazoo:consumer-event not found\n");
- }
- }
+ if(kz_amqp_consumer_fire_event(buffer) != 0) {
+ sprintf(buffer, "kazoo:consumer-event-%s", key);
+ for (p=buffer ; *p; ++p) *p = tolower(*p);
+ for (p=buffer ; *p; ++p) if(*p == '_') *p = '-';
+ if(kz_amqp_consumer_fire_event(buffer) != 0) {
+ sprintf(buffer, "kazoo:consumer-event");
+ if(kz_amqp_consumer_fire_event(buffer) != 0) {
+ LM_ERR("kazoo:consumer-event not found\n");
+ }
+ }
+ }
}
}
+ } else {
+ keng = sr_kemi_eng_get();
+ if(keng!=NULL) {
+ sip_msg_t *msg;
+ str evrtname = str_init("kazoo:consumer-event");
+
+ rtb = get_route_type();
+ msg = faked_msg_next();
+ if(sr_kemi_route(keng, msg, EVENT_ROUTE, &kazoo_event_callback,
&evrtname)<0) {
+ LM_ERR("error running event route kemi callback\n");
+ }
+ set_route_type(rtb);
+ } else {
+ LM_ERR("no event route or kemi callback found for execution\n");
+ }
}
+
Now depending on using cfg or kemi:
- kz_amqp_consumer_event() calls kz_amqp_consumer_event_cfg() or
kz_amqp_consumer_event_kemi()
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2324#discussion_r428156464