mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-15 00:41:02 +00:00
test_res_pjsip_session_caps: Create unit test
This unit test runs through combinations of... * Local codecs * Remote Codecs * Codec Preference * Incoming/Outgoing A few new APIs were created to make it easier to test the functionality but didn't result in any actual functional change. ASTERISK_28777 Change-Id: Ic8957c43e7ceeab0e9272af60ea53f056164f164
This commit is contained in:
@@ -1128,19 +1128,8 @@ static int call_offer_pref_handler(const struct aco_option *opt,
|
||||
struct ast_flags pref = { 0, };
|
||||
int outgoing = strcmp(var->name, "outgoing_call_offer_pref") == 0;
|
||||
|
||||
if (strcmp(var->value, "local") == 0) {
|
||||
ast_set_flag(&pref, AST_SIP_CALL_CODEC_PREF_LOCAL | AST_SIP_CALL_CODEC_PREF_INTERSECT | AST_SIP_CALL_CODEC_PREF_ALL);
|
||||
} else if (outgoing && strcmp(var->value, "local_merge") == 0) {
|
||||
ast_set_flag(&pref, AST_SIP_CALL_CODEC_PREF_LOCAL | AST_SIP_CALL_CODEC_PREF_UNION | AST_SIP_CALL_CODEC_PREF_ALL);
|
||||
} else if (strcmp(var->value, "local_first") == 0) {
|
||||
ast_set_flag(&pref, AST_SIP_CALL_CODEC_PREF_LOCAL | AST_SIP_CALL_CODEC_PREF_INTERSECT | AST_SIP_CALL_CODEC_PREF_FIRST);
|
||||
} else if (strcmp(var->value, "remote") == 0) {
|
||||
ast_set_flag(&pref, AST_SIP_CALL_CODEC_PREF_REMOTE | AST_SIP_CALL_CODEC_PREF_INTERSECT | AST_SIP_CALL_CODEC_PREF_ALL);
|
||||
} else if (outgoing && strcmp(var->value, "remote_merge") == 0) {
|
||||
ast_set_flag(&pref, AST_SIP_CALL_CODEC_PREF_REMOTE | AST_SIP_CALL_CODEC_PREF_UNION | AST_SIP_CALL_CODEC_PREF_ALL);
|
||||
} else if (strcmp(var->value, "remote_first") == 0) {
|
||||
ast_set_flag(&pref, AST_SIP_CALL_CODEC_PREF_REMOTE | AST_SIP_CALL_CODEC_PREF_UNION | AST_SIP_CALL_CODEC_PREF_FIRST);
|
||||
} else {
|
||||
int res = ast_sip_call_codec_str_to_pref(&pref, var->value, outgoing);
|
||||
if (res != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user