diff options
author | Alfred E. Heggestad <aeh@db.org> | 2014-02-22 17:25:01 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2014-02-22 17:25:01 +0100 |
commit | 22a712f547e764006b0341b6bc939135e593129e (patch) | |
tree | f1f589d058f3590c643aaab8fbf0a134179203dd /src/message.c | |
parent | b823b7d4481612b7047d7ad87911218893a2297b (diff) |
re api changes:
- sip_param_decode() renamed to msg_param_decode()
- use msg_ctype_cmp() to check for Content-Type
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/message.c b/src/message.c index b0e33e1..9d3662b 100644 --- a/src/message.c +++ b/src/message.c @@ -15,15 +15,12 @@ static void *recvarg; static void handle_message(struct ua *ua, const struct sip_msg *msg) { - static const char *ctype_text = "text/plain"; - struct pl mtype; + static const char ctype_text[] = "text/plain"; + struct pl ctype_pl = {ctype_text, sizeof(ctype_text)-1}; (void)ua; - if (re_regex(msg->ctype.p, msg->ctype.l, "[^;]+", &mtype)) - mtype = msg->ctype; - - if (0==pl_strcasecmp(&mtype, ctype_text) && recvh) { - recvh(&msg->from.auri, &msg->ctype, msg->mb, recvarg); + if (msg_ctype_cmp(&msg->ctyp, "text", "plain") && recvh) { + recvh(&msg->from.auri, &ctype_pl, msg->mb, recvarg); (void)sip_reply(uag_sip(), msg, 200, "OK"); } else { |