res_pjsip: Add DTMF INFO Failback mode

The existing auto dtmf mode reverts to inband if 4733 fails to be
negotiated.  This patch adds a new mode auto_info which will
switch to INFO instead of inband if 4733 is not available.

ASTERISK-27066 #close

Change-Id: Id185b11e84afd9191a2f269e8443019047765e91
This commit is contained in:
Torrey Searle
2017-06-15 10:12:41 +02:00
committed by George Joseph
parent 45df25a579
commit fb7247c57c
7 changed files with 115 additions and 12 deletions

View File

@@ -371,6 +371,8 @@ static int dtmf_handler(const struct aco_option *opt, struct ast_variable *var,
endpoint->dtmf = AST_SIP_DTMF_RFC_4733;
} else if (!strcasecmp(var->value, "inband")) {
endpoint->dtmf = AST_SIP_DTMF_INBAND;
} else if (!strcasecmp(var->value, "auto_info")) {
endpoint->dtmf = AST_SIP_DTMF_AUTO_INFO;
} else if (!strcasecmp(var->value, "info")) {
endpoint->dtmf = AST_SIP_DTMF_INFO;
} else if (!strcasecmp(var->value, "auto")) {
@@ -395,8 +397,11 @@ static int dtmf_to_str(const void *obj, const intptr_t *args, char **buf)
*buf = "inband"; break;
case AST_SIP_DTMF_INFO :
*buf = "info"; break;
case AST_SIP_DTMF_AUTO :
case AST_SIP_DTMF_AUTO :
*buf = "auto"; break;
case AST_SIP_DTMF_AUTO_INFO :
*buf = "auto_info";
break;
default:
*buf = "none";
}