ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 0);
} else if (!strcasecmp(v->name, "dtmfmode")) {
if (!strcasecmp(v->value, "inband")) {
- options->dtmfmode = H323_DTMF_INBAND;
+ options->dtmfmode |= H323_DTMF_INBAND;
} else if (!strcasecmp(v->value, "rfc2833")) {
- options->dtmfmode = H323_DTMF_RFC2833;
+ options->dtmfmode |= H323_DTMF_RFC2833;
} else {
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")) {
tmp = atoi(v->value);
oldha = user->ha;
user->ha = (struct ast_ha *)NULL;
memcpy(&user->options, &global_options, sizeof(user->options));
+ user->options.dtmfmode = 0;
/* Set default context */
strncpy(user->context, default_context, sizeof(user->context) - 1);
if (user && !found)
user->ha = ast_append_ha(v->name, v->value, user->ha);
}
}
+ if (!user->options.dtmfmode)
+ user->options.dtmfmode = global_options.dtmfmode;
ASTOBJ_UNMARK(user);
ast_free_ha(oldha);
return user;
oldha = peer->ha;
peer->ha = NULL;
memcpy(&peer->options, &global_options, sizeof(peer->options));
+ peer->options.dtmfmode = 0;
peer->addr.sin_port = htons(h323_signalling_port);
peer->addr.sin_family = AF_INET;
if (!found && name)
ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
}
}
+ if (!peer->options.dtmfmode)
+ peer->options.dtmfmode = global_options.dtmfmode;
ASTOBJ_UNMARK(peer);
ast_free_ha(oldha);
return peer;
global_options.fastStart = 1;
global_options.h245Tunneling = 1;
global_options.dtmfcodec = H323_DTMF_RFC2833_PT;
- global_options.dtmfmode = H323_DTMF_RFC2833;
+ global_options.dtmfmode = 0;
global_options.capability = GLOBAL_CAPABILITY;
global_options.bridge = 1; /* Do native bridging by default */
strncpy(default_context, "default", sizeof(default_context) - 1);
/* 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)) {
if (strcasecmp(cat, "general")) {
void MyH323Connection::OnUserInputTone(char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp)
{
- if (dtmfMode == H323_DTMF_RFC2833) {
+ if ((dtmfMode & H323_DTMF_RFC2833)) {
if (h323debug) {
cout << "\t-- Received user input tone (" << tone << ") from remote" << endl;
}
if (cap != NULL) {
RTP_DataFrame::PayloadTypes pt = ((H323_UserInputCapability*)cap)->GetPayloadType();
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;
if (h323debug) {
cout << "\t-- Inbound RFC2833 on payload " << pt << endl;
lastcap++;
dtmfMode = dtmf_mode;
- if (dtmf_mode == H323_DTMF_INBAND) {
+ if ((dtmfMode & H323_DTMF_INBAND)) {
localCapabilities.SetCapability(0, lastcap, new H323_UserInputCapability(H323_UserInputCapability::BasicString));
sendUserInputMode = SendUserInputAsString;
} else {