summaryrefslogtreecommitdiff
path: root/funcs/func_callerid.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_callerid.c')
-rw-r--r--funcs/func_callerid.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c
index b4649c177..4f6a6779b 100644
--- a/funcs/func_callerid.c
+++ b/funcs/func_callerid.c
@@ -900,6 +900,11 @@ static int callerpres_deprecate_notify;
*/
static int callerpres_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
if (!callerpres_deprecate_notify) {
callerpres_deprecate_notify = 1;
ast_log(LOG_WARNING, "CALLERPRES is deprecated."
@@ -926,6 +931,11 @@ static int callerpres_write(struct ast_channel *chan, const char *cmd, char *dat
{
int pres;
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
if (!callerpres_deprecate_notify) {
callerpres_deprecate_notify = 1;
ast_log(LOG_WARNING, "CALLERPRES is deprecated."