Skip to content

Commit

Permalink
sca: exported functions to kemi framework
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Dec 7, 2017
1 parent 3ecd195 commit 73e9139
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
55 changes: 55 additions & 0 deletions src/modules/sca/sca.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "../../core/timer.h"
#include "../../core/timer_proc.h"
#include "../../core/mod_fix.h"
#include "../../core/kemi.h"

#include "sca.h"
#include "sca_appearance.h"
Expand Down Expand Up @@ -479,6 +480,19 @@ static int sca_call_info_update_3_f(sip_msg_t* msg,
return sca_call_info_update(msg, update_mask, &uri_to, &uri_from);
}

int ki_sca_call_info_update_default(sip_msg_t *msg)
{
return sca_call_info_update(msg, SCA_CALL_INFO_SHARED_BOTH, NULL, NULL);
}
int ki_sca_call_info_update_mask(sip_msg_t *msg, int umask)
{
return sca_call_info_update(msg, umask, NULL, NULL);
}
int ki_sca_call_info_update_turi(sip_msg_t *msg, int umask, str *sto)
{
return sca_call_info_update(msg, umask, sto, NULL);
}

int fixup_ciu(void **param, int param_no)
{
switch (param_no) {
Expand All @@ -504,3 +518,44 @@ int fixup_free_ciu(void **param, int param_no)
return E_UNSPEC;
}
}

/**
*
*/
/* clang-format off */
static sr_kemi_t sr_kemi_sca_exports[] = {
{ str_init("sca"), str_init("handle_subscribe"),
SR_KEMIP_INT, ki_sca_handle_subscribe,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("sca"), str_init("call_info_update_default"),
SR_KEMIP_INT, ki_sca_call_info_update_default,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("sca"), str_init("call_info_update_mask"),
SR_KEMIP_INT, ki_sca_call_info_update_mask,
{ SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("sca"), str_init("call_info_update_turi"),
SR_KEMIP_INT, ki_sca_call_info_update_turi,
{ SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("sca"), str_init("call_info_update"),
SR_KEMIP_INT, sca_call_info_update,
{ SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_STR,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},

{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};
/* clang-format on */

int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
sr_kemi_modules_add(sr_kemi_sca_exports);
return 0;
}
7 changes: 6 additions & 1 deletion src/modules/sca/sca_subscribe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ int sca_subscription_from_request(sca_mod *scam, sip_msg_t *msg, int event_type,
return (-1);
}

int sca_handle_subscribe(sip_msg_t *msg, char *p1, char *p2)
int ki_sca_handle_subscribe(sip_msg_t *msg)
{
sca_subscription req_sub;
sca_subscription *sub = NULL;
Expand Down Expand Up @@ -1354,6 +1354,11 @@ int sca_handle_subscribe(sip_msg_t *msg, char *p1, char *p2)
return (rc);
}

int sca_handle_subscribe(sip_msg_t *msg, char *p1, char *p2)
{
return ki_sca_handle_subscribe(msg);
}

int sca_subscription_reply(sca_mod *scam, int status_code, char *status_msg,
int event_type, int expires, sip_msg_t *msg)
{
Expand Down
1 change: 1 addition & 0 deletions src/modules/sca/sca_subscribe.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ void sca_subscription_state_to_str(int, str *);
int sca_subscription_aor_has_subscribers(int, str *);
int sca_subscription_delete_subscriber_for_event(sca_mod *, str *, str *, str *);
int sca_subscription_terminate(sca_mod *, str *, int, str *, int, int);
int ki_sca_handle_subscribe(sip_msg_t *msg);

#endif // SCA_SUBSCRIBE_H

0 comments on commit 73e9139

Please sign in to comment.