diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c index 054552b5ae..6c0aff30b1 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -707,7 +707,7 @@ int pjsip_acf_channel_read(struct ast_channel *chan, const char *cmd, char *data /* Sanity check */ if (strcmp(ast_channel_tech(chan)->type, "PJSIP")) { - ast_log(LOG_ERROR, "Cannot call %s on a non-PJSIP channel\n", cmd); + ast_log(LOG_WARNING, "Cannot call %s on a non-PJSIP channel\n", cmd); return 0; } @@ -866,6 +866,11 @@ int pjsip_acf_media_offer_read(struct ast_channel *chan, const char *cmd, char * return -1; } + if (strcmp(ast_channel_tech(chan)->type, "PJSIP")) { + ast_log(LOG_WARNING, "Cannot call %s on a non-PJSIP channel\n", cmd); + return -1; + } + channel = ast_channel_tech_pvt(chan); if (!strcmp(data, "audio")) { @@ -889,6 +894,11 @@ int pjsip_acf_media_offer_write(struct ast_channel *chan, const char *cmd, char return -1; } + if (strcmp(ast_channel_tech(chan)->type, "PJSIP")) { + ast_log(LOG_WARNING, "Cannot call %s on a non-PJSIP channel\n", cmd); + return -1; + } + channel = ast_channel_tech_pvt(chan); mdata.session = channel->session;