diff --git a/src/modules/kemix/kemix_mod.c b/src/modules/kemix/kemix_mod.c index f94ff951d4c..fdedda04be6 100644 --- a/src/modules/kemix/kemix_mod.c +++ b/src/modules/kemix/kemix_mod.c @@ -872,6 +872,25 @@ static int ki_kx_get_msglen(sip_msg_t *msg) return msg->len; } +/** + * + */ +static int ki_kx_get_msgtype(sip_msg_t *msg) +{ + if(msg==NULL) { + return -1; + } + + if(msg->first_line.type == SIP_REQUEST) { + return 1; + } else if(msg->first_line.type == SIP_REPLY) { + return 2; + } + + return 0; +} + + /** * */ @@ -1122,6 +1141,11 @@ static sr_kemi_t sr_kemi_kx_exports[] = { { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("kx"), str_init("get_msgtype"), + SR_KEMIP_INT, ki_kx_get_msgtype, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }