tmp->permhidecallerid = conf->chan.hidecallerid;
tmp->hidecalleridname = conf->chan.hidecalleridname;
tmp->callreturn = conf->chan.callreturn;
+ tmp->lastnumredial = conf->chan.lastnumredial; /* Not used in DAHDI pvt, only analog pvt */
tmp->echocancel = conf->chan.echocancel;
tmp->echotraining = conf->chan.echotraining;
tmp->pulse = conf->chan.pulse;
analog_p->permcallwaiting = conf->chan.callwaiting; /* permcallwaiting possibly modified in analog_config_complete */
analog_p->calledsubscriberheld = conf->chan.calledsubscriberheld; /* Only actually used in analog pvt, not DAHDI pvt */
analog_p->callreturn = conf->chan.callreturn;
+ analog_p->lastnumredial = conf->chan.lastnumredial; /* Only actually used in analog pvt, not DAHDI pvt */
analog_p->cancallforward = conf->chan.cancallforward;
analog_p->canpark = conf->chan.canpark;
analog_p->dahditrcallerid = conf->chan.dahditrcallerid;
parse_busy_pattern(v, &confp->chan.busy_cadence);
} else if (!strcasecmp(v->name, "calledsubscriberheld")) {
confp->chan.calledsubscriberheld = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "lastnumredial")) {
+ confp->chan.lastnumredial = ast_true(v->value);
} else if (!strcasecmp(v->name, "callprogress")) {
confp->chan.callprogress &= ~CALLPROGRESS_PROGRESS;
if (ast_true(v->value))
* \note Used by SS7. Otherwise set but not used.
*/
unsigned int inservice:1;
+ /*! *\brief TRUE if last number redial enabled */
+ unsigned int lastnumredial:1;
/*!
* \brief Bitmask for the channel being locally blocked.
* \note Applies to SS7 and MFCR2 channels.
if (extlen < strlen(pickupexten) && !strncmp(pickupexten, exten, extlen)) {
return 1;
}
+ if (exten[0] == '#' && extlen < 2) {
+ return 1; /* Could match ## */
+ }
/* hardcoded features are *60, *67, *69, *70, *72, *73, *78, *79, *82, *0 */
if (exten[0] == '*' && extlen < 3) {
if (extlen == 1) {
if (ast_parking_provider_registered()) {
is_exten_parking = ast_parking_is_exten_park(ast_channel_context(chan), exten);
}
+ if (p->lastnumredial && !strcmp(exten, "##") && !ast_exists_extension(chan, ast_channel_context(chan), "##", 1, p->cid_num)) {
+ /* Last Number Redial */
+ if (!ast_strlen_zero(p->lastexten)) {
+ ast_verb(4, "Redialing last number dialed on channel %d\n", p->channel);
+ ast_copy_string(exten, p->lastexten, sizeof(exten));
+ } else {
+ ast_verb(3, "Last Number Redial not possible on channel %d (no saved number)\n", p->channel);
+ res = analog_play_tone(p, idx, ANALOG_TONE_CONGESTION);
+ analog_wait_event(p);
+ ast_hangup(chan);
+ goto quit;
+ }
+ }
if (ast_exists_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num) && !is_exten_parking) {
if (!res || !ast_matchmore_extension(chan, ast_channel_context(chan), exten, 1, p->cid_num)) {
if (getforward) {
ast_channel_lock(chan);
ast_channel_exten_set(chan, exten);
+ /* Save the last number dialed, for Last Number Redial. */
+ if (!p->immediate) {
+ ast_copy_string(p->lastexten, exten, sizeof(p->lastexten));
+ }
+
/* Properly set the presentation.
* We need to do this here as well, because p->hidecallerid might be set
* due to permanent blocking, not star-67/star-82 usage. */
unsigned int hanguponpolarityswitch:1;
unsigned int immediate:1;
unsigned int immediatering:1; /*!< TRUE if ringing should be provided for immediate execution */
+ unsigned int lastnumredial:1; /*!< TRUE if last number redial allowed */
unsigned int permcallwaiting:1; /*!< TRUE if call waiting is enabled. (Configured option) */
unsigned int permhidecallerid:1; /*!< Whether to hide our outgoing caller ID or not */
unsigned int pulse:1;
char callwait_name[AST_MAX_EXTENSION];
char lastcid_num[AST_MAX_EXTENSION];
char lastcid_name[AST_MAX_EXTENSION];
+ char lastexten[AST_MAX_EXTENSION]; /*!< Last number dialed */
struct ast_party_caller caller;
int redirecting_reason; /*!< Redirecting reason */
;
callreturn=yes
;
+; Whether or not to allow redialing the last number called using Last Number Redial
+; (##, if your dialplan doesn't catch this first)
+;
+;lastnumredial=yes
+;
; Stutter dialtone support: If voicemail is received in the mailbox then
; taking the phone off hook will cause a stutter dialtone instead of a
; normal one.