diff options
Diffstat (limited to 'res/res_pjsip_header_funcs.c')
-rw-r--r-- | res/res_pjsip_header_funcs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/res/res_pjsip_header_funcs.c b/res/res_pjsip_header_funcs.c index 7425d8f59..11ab44c10 100644 --- a/res/res_pjsip_header_funcs.c +++ b/res/res_pjsip_header_funcs.c @@ -452,6 +452,11 @@ static int func_read_header(struct ast_channel *chan, const char *function, char AST_APP_ARG(header_name); AST_APP_ARG(header_number);); AST_STANDARD_APP_ARGS(args, data); + if (!channel) { + ast_log(LOG_ERROR, "This function requires a PJSIP channel.\n"); + return -1; + } + if (ast_strlen_zero(args.action)) { ast_log(AST_LOG_ERROR, "This function requires an action.\n"); return -1; @@ -506,6 +511,11 @@ static int func_write_header(struct ast_channel *chan, const char *cmd, char *da AST_APP_ARG(header_name); AST_APP_ARG(header_number);); AST_STANDARD_APP_ARGS(args, data); + if (!channel) { + ast_log(LOG_ERROR, "This function requires a PJSIP channel.\n"); + return -1; + } + if (ast_strlen_zero(args.action)) { ast_log(AST_LOG_ERROR, "This function requires an action.\n"); return -1; |