summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
40275f8)
Part of the work done for connected line was to add an optional
argument to the 'f' option to allow for the connected party information
of the outgoing channel to be set to the argument provided. This was
overlooked during the merge of the work to trunk and is being added
back now. The CHANGES file has also been updated to note this change.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237803
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
* Page has a new option 'A(x)' which will playback an announcement simultaneously
to all paged phones (and optionally excluding the caller's one using the new
option 'n') before the call is bridged.
* Page has a new option 'A(x)' which will playback an announcement simultaneously
to all paged phones (and optionally excluding the caller's one using the new
option 'n') before the call is bridged.
+ * The 'f' option to Dial has been augmented to take an optional argument. If no
+ argument is provided, the 'f' option works as it always has. If an argument is
+ provided, then the connected party information of all outgoing channels created
+ during the Dial will be set to the argument passed to the 'f' option.
Dialplan Functions
------------------
Dialplan Functions
------------------
<para>Execute the <literal>h</literal> extension for peer after the call ends</para>
</option>
<option name="f">
<para>Execute the <literal>h</literal> extension for peer after the call ends</para>
</option>
<option name="f">
- <para>Force the callerid of the <emphasis>calling</emphasis> channel to be set as the
- extension associated with the channel using a dialplan <literal>hint</literal>.
+ <argument name="x" required="false" />
+ <para>If <replaceable>x</replaceable> is not provided, force the callerid of the <emphasis>calling</emphasis>
+ channel to be set as the extension associated with the channel using a dialplan <literal>hint</literal>.
For example, some PSTNs do not allow CallerID to be set to anything
For example, some PSTNs do not allow CallerID to be set to anything
- other than the number assigned to the caller.</para>
+ other than the number assigned to the caller. If <replaceable>x</replaceable> is provided, though, then
+ this option behaves quite differently. Any outgoing channel created will have its connected party information
+ set to <replaceable>x</replaceable></para>
</option>
<option name="F" argsep="^">
<argument name="context" required="false" />
</option>
<option name="F" argsep="^">
<argument name="context" required="false" />
OPT_ARG_DURATION_STOP,
OPT_ARG_OPERMODE,
OPT_ARG_SCREEN_NOINTRO,
OPT_ARG_DURATION_STOP,
OPT_ARG_OPERMODE,
OPT_ARG_SCREEN_NOINTRO,
/* note: this entry _MUST_ be the last one in the enum */
OPT_ARG_ARRAY_SIZE,
};
/* note: this entry _MUST_ be the last one in the enum */
OPT_ARG_ARRAY_SIZE,
};
AST_APP_OPTION('d', OPT_DTMF_EXIT),
AST_APP_OPTION_ARG('D', OPT_SENDDTMF, OPT_ARG_SENDDTMF),
AST_APP_OPTION('e', OPT_PEER_H),
AST_APP_OPTION('d', OPT_DTMF_EXIT),
AST_APP_OPTION_ARG('D', OPT_SENDDTMF, OPT_ARG_SENDDTMF),
AST_APP_OPTION('e', OPT_PEER_H),
- AST_APP_OPTION('f', OPT_FORCECLID),
+ AST_APP_OPTION_ARG('f', OPT_FORCECLID, OPT_ARG_FORCECLID),
AST_APP_OPTION_ARG('F', OPT_CALLEE_GO_ON, OPT_ARG_CALLEE_GO_ON),
AST_APP_OPTION('g', OPT_GO_ON),
AST_APP_OPTION_ARG('G', OPT_GOTO, OPT_ARG_GOTO),
AST_APP_OPTION_ARG('F', OPT_CALLEE_GO_ON, OPT_ARG_CALLEE_GO_ON),
AST_APP_OPTION('g', OPT_GO_ON),
AST_APP_OPTION_ARG('G', OPT_GOTO, OPT_ARG_GOTO),
struct cause_args num = { chan, 0, 0, 0 };
int cause;
char numsubst[256];
struct cause_args num = { chan, 0, 0, 0 };
int cause;
char numsubst[256];
- char cidname[AST_MAX_EXTENSION] = "";
+ char *cid_num = NULL, *cid_name = NULL;
struct ast_bridge_config config = { { 0, } };
struct timeval calldurationlimit = { 0, };
struct ast_bridge_config config = { { 0, } };
struct timeval calldurationlimit = { 0, };
+ if (ast_test_flag64(&opts, OPT_FORCECLID) && !ast_strlen_zero(opt_args[OPT_ARG_FORCECLID]))
+ ast_callerid_parse(opt_args[OPT_ARG_FORCECLID], &cid_name, &cid_num);
if (ast_test_flag64(&opts, OPT_RESETCDR) && chan->cdr)
ast_cdr_reset(chan->cdr, NULL);
if (ast_test_flag64(&opts, OPT_PRIVACY) && ast_strlen_zero(opt_args[OPT_ARG_PRIVACY]))
if (ast_test_flag64(&opts, OPT_RESETCDR) && chan->cdr)
ast_cdr_reset(chan->cdr, NULL);
if (ast_test_flag64(&opts, OPT_PRIVACY) && ast_strlen_zero(opt_args[OPT_ARG_PRIVACY]))
}
ast_channel_unlock(chan);
ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE |
}
ast_channel_unlock(chan);
ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING | OPT_IGNORE_CONNECTEDLINE |
- OPT_CANCEL_TIMEOUT | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB);
+ OPT_CANCEL_TIMEOUT | OPT_ANNOUNCE | OPT_CALLEE_MACRO | OPT_CALLEE_GOSUB | OPT_FORCECLID);
/* loop through the list of dial destinations */
rest = args.peers;
/* loop through the list of dial destinations */
rest = args.peers;
}
ast_set_flag64(tmp, DIAL_NOCONNECTEDLINE);
}
}
ast_set_flag64(tmp, DIAL_NOCONNECTEDLINE);
}
-
- ast_connected_line_copy_from_caller(&tc->connected, &chan->cid);
+
+ if (ast_test_flag64(peerflags, OPT_FORCECLID) && !ast_strlen_zero(opt_args[OPT_ARG_FORCECLID])) {
+ struct ast_party_connected_line connected;
+
+ ast_party_connected_line_set_init(&connected, &tmp->chan->connected);
+ connected.id.number = cid_num;
+ connected.id.name = cid_name;
+ connected.id.number_presentation = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
+ ast_channel_set_connected_line(tmp->chan, &connected);
+ } else {
+ ast_connected_line_copy_from_caller(&tmp->chan->connected, &chan->cid);
+ }
S_REPLACE(tc->cid.cid_rdnis, ast_strdup(chan->cid.cid_rdnis));
ast_party_redirecting_copy(&tc->redirecting, &chan->redirecting);
S_REPLACE(tc->cid.cid_rdnis, ast_strdup(chan->cid.cid_rdnis));
ast_party_redirecting_copy(&tc->redirecting, &chan->redirecting);
ast_verb(3, "Called %s\n", numsubst);
ast_channel_unlock(chan);
if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
ast_verb(3, "Called %s\n", numsubst);
ast_channel_unlock(chan);
if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
+ char cidname[AST_MAX_EXTENSION];
ast_set_callerid(tc, tmpexten, get_cid_name(cidname, sizeof(cidname), chan), NULL);
}
}
ast_set_callerid(tc, tmpexten, get_cid_name(cidname, sizeof(cidname), chan), NULL);
}
}