mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
DTMF mode is bitmask, not valued field
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1254,12 +1254,12 @@ static int update_common_options(struct ast_variable *v, struct call_options *op
|
|||||||
ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 0);
|
ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 0);
|
||||||
} else if (!strcasecmp(v->name, "dtmfmode")) {
|
} else if (!strcasecmp(v->name, "dtmfmode")) {
|
||||||
if (!strcasecmp(v->value, "inband")) {
|
if (!strcasecmp(v->value, "inband")) {
|
||||||
options->dtmfmode = H323_DTMF_INBAND;
|
options->dtmfmode |= H323_DTMF_INBAND;
|
||||||
} else if (!strcasecmp(v->value, "rfc2833")) {
|
} else if (!strcasecmp(v->value, "rfc2833")) {
|
||||||
options->dtmfmode = H323_DTMF_RFC2833;
|
options->dtmfmode |= H323_DTMF_RFC2833;
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "Unknown dtmf mode '%s', using rfc2833\n", v->value);
|
ast_log(LOG_WARNING, "Unknown dtmf mode '%s', using rfc2833\n", v->value);
|
||||||
options->dtmfmode = H323_DTMF_RFC2833;
|
options->dtmfmode |= H323_DTMF_RFC2833;
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(v->name, "dtmfcodec")) {
|
} else if (!strcasecmp(v->name, "dtmfcodec")) {
|
||||||
tmp = atoi(v->value);
|
tmp = atoi(v->value);
|
||||||
@@ -1333,6 +1333,7 @@ static struct oh323_user *build_user(char *name, struct ast_variable *v, struct
|
|||||||
oldha = user->ha;
|
oldha = user->ha;
|
||||||
user->ha = (struct ast_ha *)NULL;
|
user->ha = (struct ast_ha *)NULL;
|
||||||
memcpy(&user->options, &global_options, sizeof(user->options));
|
memcpy(&user->options, &global_options, sizeof(user->options));
|
||||||
|
user->options.dtmfmode = 0;
|
||||||
/* Set default context */
|
/* Set default context */
|
||||||
strncpy(user->context, default_context, sizeof(user->context) - 1);
|
strncpy(user->context, default_context, sizeof(user->context) - 1);
|
||||||
if (user && !found)
|
if (user && !found)
|
||||||
@@ -1377,6 +1378,8 @@ static struct oh323_user *build_user(char *name, struct ast_variable *v, struct
|
|||||||
user->ha = ast_append_ha(v->name, v->value, user->ha);
|
user->ha = ast_append_ha(v->name, v->value, user->ha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!user->options.dtmfmode)
|
||||||
|
user->options.dtmfmode = global_options.dtmfmode;
|
||||||
ASTOBJ_UNMARK(user);
|
ASTOBJ_UNMARK(user);
|
||||||
ast_free_ha(oldha);
|
ast_free_ha(oldha);
|
||||||
return user;
|
return user;
|
||||||
@@ -1438,6 +1441,7 @@ static struct oh323_peer *build_peer(const char *name, struct ast_variable *v, s
|
|||||||
oldha = peer->ha;
|
oldha = peer->ha;
|
||||||
peer->ha = NULL;
|
peer->ha = NULL;
|
||||||
memcpy(&peer->options, &global_options, sizeof(peer->options));
|
memcpy(&peer->options, &global_options, sizeof(peer->options));
|
||||||
|
peer->options.dtmfmode = 0;
|
||||||
peer->addr.sin_port = htons(h323_signalling_port);
|
peer->addr.sin_port = htons(h323_signalling_port);
|
||||||
peer->addr.sin_family = AF_INET;
|
peer->addr.sin_family = AF_INET;
|
||||||
if (!found && name)
|
if (!found && name)
|
||||||
@@ -1475,6 +1479,8 @@ static struct oh323_peer *build_peer(const char *name, struct ast_variable *v, s
|
|||||||
ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
|
ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!peer->options.dtmfmode)
|
||||||
|
peer->options.dtmfmode = global_options.dtmfmode;
|
||||||
ASTOBJ_UNMARK(peer);
|
ASTOBJ_UNMARK(peer);
|
||||||
ast_free_ha(oldha);
|
ast_free_ha(oldha);
|
||||||
return peer;
|
return peer;
|
||||||
@@ -2729,7 +2735,7 @@ static int reload_config(int is_reload)
|
|||||||
global_options.fastStart = 1;
|
global_options.fastStart = 1;
|
||||||
global_options.h245Tunneling = 1;
|
global_options.h245Tunneling = 1;
|
||||||
global_options.dtmfcodec = H323_DTMF_RFC2833_PT;
|
global_options.dtmfcodec = H323_DTMF_RFC2833_PT;
|
||||||
global_options.dtmfmode = H323_DTMF_RFC2833;
|
global_options.dtmfmode = 0;
|
||||||
global_options.capability = GLOBAL_CAPABILITY;
|
global_options.capability = GLOBAL_CAPABILITY;
|
||||||
global_options.bridge = 1; /* Do native bridging by default */
|
global_options.bridge = 1; /* Do native bridging by default */
|
||||||
strncpy(default_context, "default", sizeof(default_context) - 1);
|
strncpy(default_context, "default", sizeof(default_context) - 1);
|
||||||
@@ -2822,6 +2828,8 @@ static int reload_config(int is_reload)
|
|||||||
/* dummy */
|
/* dummy */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!global_options.dtmfmode)
|
||||||
|
global_options.dtmfmode = H323_DTMF_RFC2833;
|
||||||
|
|
||||||
for (cat = ast_category_browse(cfg, NULL); cat; cat = ast_category_browse(cfg, cat)) {
|
for (cat = ast_category_browse(cfg, NULL); cat; cat = ast_category_browse(cfg, cat)) {
|
||||||
if (strcasecmp(cat, "general")) {
|
if (strcasecmp(cat, "general")) {
|
||||||
|
@@ -1204,7 +1204,7 @@ void MyH323Connection::SendUserInputTone(char tone, unsigned duration, unsigned
|
|||||||
|
|
||||||
void MyH323Connection::OnUserInputTone(char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp)
|
void MyH323Connection::OnUserInputTone(char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp)
|
||||||
{
|
{
|
||||||
if (dtmfMode == H323_DTMF_RFC2833) {
|
if ((dtmfMode & H323_DTMF_RFC2833)) {
|
||||||
if (h323debug) {
|
if (h323debug) {
|
||||||
cout << "\t-- Received user input tone (" << tone << ") from remote" << endl;
|
cout << "\t-- Received user input tone (" << tone << ") from remote" << endl;
|
||||||
}
|
}
|
||||||
@@ -1299,7 +1299,7 @@ BOOL MyH323Connection::OnReceivedCapabilitySet(const H323Capabilities & remoteCa
|
|||||||
if (cap != NULL) {
|
if (cap != NULL) {
|
||||||
RTP_DataFrame::PayloadTypes pt = ((H323_UserInputCapability*)cap)->GetPayloadType();
|
RTP_DataFrame::PayloadTypes pt = ((H323_UserInputCapability*)cap)->GetPayloadType();
|
||||||
on_set_rfc2833_payload(GetCallReference(), (const char *)GetCallToken(), (int)pt);
|
on_set_rfc2833_payload(GetCallReference(), (const char *)GetCallToken(), (int)pt);
|
||||||
if ((dtmfMode == H323_DTMF_RFC2833) && (sendUserInputMode == SendUserInputAsTone))
|
if ((dtmfMode & H323_DTMF_RFC2833) && (sendUserInputMode == SendUserInputAsTone))
|
||||||
sendUserInputMode = SendUserInputAsInlineRFC2833;
|
sendUserInputMode = SendUserInputAsInlineRFC2833;
|
||||||
if (h323debug) {
|
if (h323debug) {
|
||||||
cout << "\t-- Inbound RFC2833 on payload " << pt << endl;
|
cout << "\t-- Inbound RFC2833 on payload " << pt << endl;
|
||||||
@@ -1514,7 +1514,7 @@ void MyH323Connection::SetCapabilities(int cap, int dtmf_mode, void *_prefs, int
|
|||||||
|
|
||||||
lastcap++;
|
lastcap++;
|
||||||
dtmfMode = dtmf_mode;
|
dtmfMode = dtmf_mode;
|
||||||
if (dtmf_mode == H323_DTMF_INBAND) {
|
if ((dtmfMode & H323_DTMF_INBAND)) {
|
||||||
localCapabilities.SetCapability(0, lastcap, new H323_UserInputCapability(H323_UserInputCapability::BasicString));
|
localCapabilities.SetCapability(0, lastcap, new H323_UserInputCapability(H323_UserInputCapability::BasicString));
|
||||||
sendUserInputMode = SendUserInputAsString;
|
sendUserInputMode = SendUserInputAsString;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user