diff options
author | George Joseph <gjoseph@digium.com> | 2017-09-11 04:46:35 -0600 |
---|---|---|
committer | George Joseph <gjoseph@digium.com> | 2017-09-13 09:24:28 -0500 |
commit | 446d48fd497786cdf6deff779131fa5fefd64b94 (patch) | |
tree | 9f221699c93287dfa3d69a63e5bc40af5b3ca6a0 /main/strings.c | |
parent | ec940f4fec4e216b30be562a31ec3586f7d302c3 (diff) |
res_pjsip: Add handling for incoming unsolicited MWI NOTIFY
A new endpoint parameter "incoming_mwi_mailbox" allows Asterisk to
receive unsolicited MWI NOTIFY requests and make them available to
other modules via the stasis message bus.
res_pjsip_pubsub has a new handler "pubsub_on_rx_mwi_notify_request"
that parses a simple-message-summary body and, if
endpoint->incoming_mwi_account is set, calls ast_publish_mwi_state
with the voice-message counts from the message.
Change-Id: I08bae3d16e77af48fcccc2c936acce8fc0ef0f3c
Diffstat (limited to 'main/strings.c')
-rw-r--r-- | main/strings.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/main/strings.c b/main/strings.c index d29da67bc..3207fa15e 100644 --- a/main/strings.c +++ b/main/strings.c @@ -369,4 +369,23 @@ equals: return 0; } +char *ast_read_line_from_buffer(char **buffer) +{ + char *start = *buffer; + + if (!buffer || !*buffer || *(*buffer) == '\0') { + return NULL; + } + + while (*(*buffer) && *(*buffer) != '\n' ) { + (*buffer)++; + } + + *(*buffer) = '\0'; + if (*(*buffer - 1) == '\r') { + *(*buffer - 1) = '\0'; + } + (*buffer)++; + return start; +} |