diff --git a/chan_capi.c b/chan_capi.c index 44d3bff..95fc21e 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -873,6 +873,7 @@ static int capi_send_answer(struct ast_channel *c, int *bprot, _cstruct b3conf) _cmsg CMSG; char buf[AST_CAPI_MAX_STRING]; char *dnid; + char *connectednumber; if ((i->isdnmode == AST_CAPI_ISDNMODE_PTP) && ((strlen(i->incomingmsn) < strlen(i->dnid)) && @@ -881,6 +882,9 @@ static int capi_send_answer(struct ast_channel *c, int *bprot, _cstruct b3conf) } else { dnid = i->dnid; } + if ((connectednumber = pbx_builtin_getvar_helper(c, "CONNECTEDNUMBER"))) { + dnid = connectednumber; + } memset(&CMSG, 0, sizeof(CMSG));