diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 5dad5391017da70a13779d9acfb472bf6417854f..84a7025634bb8bfc56a13d1d339bbd56ba8f58cc 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -1407,6 +1407,7 @@ static struct dahdi_chan_conf dahdi_chan_conf_default(void) .localprefix = "", .privateprefix = "", .unknownprefix = "", + .colp_send = SIG_PRI_COLP_UPDATE, .resetinterval = -1, }, #endif @@ -12691,6 +12692,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, #if defined(HAVE_PRI_L2_PERSISTENCE) pris[span].pri.l2_persistence = conf->pri.pri.l2_persistence; #endif /* defined(HAVE_PRI_L2_PERSISTENCE) */ + pris[span].pri.colp_send = conf->pri.pri.colp_send; #if defined(HAVE_PRI_AOC_EVENTS) pris[span].pri.aoc_passthrough_flag = conf->pri.pri.aoc_passthrough_flag; pris[span].pri.aoce_delayhangup = conf->pri.pri.aoce_delayhangup; @@ -17975,6 +17977,16 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct confp->pri.pri.l2_persistence = PRI_L2_PERSISTENCE_DEFAULT; } #endif /* defined(HAVE_PRI_L2_PERSISTENCE) */ + } else if (!strcasecmp(v->name, "colp_send")) { + if (!strcasecmp(v->value, "block")) { + confp->pri.pri.colp_send = SIG_PRI_COLP_BLOCK; + } else if (!strcasecmp(v->value, "connect")) { + confp->pri.pri.colp_send = SIG_PRI_COLP_CONNECT; + } else if (!strcasecmp(v->value, "update")) { + confp->pri.pri.colp_send = SIG_PRI_COLP_UPDATE; + } else { + confp->pri.pri.colp_send = SIG_PRI_COLP_UPDATE; + } #endif /* HAVE_PRI */ #if defined(HAVE_SS7) } else if (!strcasecmp(v->name, "ss7type")) { diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 093d8ad83aa22f5cf08c912c24cee60725af564e..feb86fdae12379485be304e43f2ca020f4b6d0db 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -8019,8 +8019,34 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi struct pri_party_connected_line connected; int dialplan; int prefix_strip; + int colp_allowed = 0; pri_grab(p, p->pri); + + /* Check if a connected line update is allowed at this time. */ + switch (p->pri->colp_send) { + case SIG_PRI_COLP_BLOCK: + break; + case SIG_PRI_COLP_CONNECT: + /* + * Outgoing calls receive CONNECT and act like an update before + * the call is connected. + */ + if (p->call_level <= SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing) { + colp_allowed = 1; + } + break; + case SIG_PRI_COLP_UPDATE: + colp_allowed = 1; + break; + } + if (!colp_allowed) { + pri_rel(p->pri); + ast_debug(1, "Blocked AST_CONTROL_CONNECTED_LINE on %s\n", + ast_channel_name(chan)); + break; + } + memset(&connected, 0, sizeof(connected)); sig_pri_party_id_from_ast(&connected.id, &ast_channel_connected(chan)->id); diff --git a/channels/sig_pri.h b/channels/sig_pri.h index 8123f6bf86ab9e8ca01db1b7008cc5c2f1828dcc..3317c7ef50872dd2f3c3aaa61f22489d1134a555 100644 --- a/channels/sig_pri.h +++ b/channels/sig_pri.h @@ -391,6 +391,15 @@ struct sig_pri_mbox { }; #endif /* defined(HAVE_PRI_MWI) */ +enum sig_pri_colp_signaling { + /*! Block all connected line updates. */ + SIG_PRI_COLP_BLOCK, + /*! Only send connected line information with the CONNECT message. */ + SIG_PRI_COLP_CONNECT, + /*! Allow all connected line updates. */ + SIG_PRI_COLP_UPDATE, +}; + struct sig_pri_span { /* Should be set by user */ struct ast_cc_config_params *cc_params; /*!< CC config parameters for each new call. */ @@ -452,6 +461,8 @@ struct sig_pri_span { char privateprefix[20]; /*!< for private dialplans */ char unknownprefix[20]; /*!< for unknown dialplans */ enum sig_pri_moh_signaling moh_signaling; + /*! Send connected line signaling to peer option. */ + enum sig_pri_colp_signaling colp_send; long resetinterval; /*!< Interval (in seconds) for resetting unused channels */ #if defined(HAVE_PRI_DISPLAY_TEXT) unsigned long display_flags_send; /*!< PRI_DISPLAY_OPTION_xxx flags for display text sending */ diff --git a/configs/chan_dahdi.conf.sample b/configs/chan_dahdi.conf.sample index d83bba8d9b38a88166051c0f0a1f987af3c82297..4ba56999b9d5fa9afb341d335791362b26885468 100644 --- a/configs/chan_dahdi.conf.sample +++ b/configs/chan_dahdi.conf.sample @@ -249,6 +249,15 @@ context=public ; ;datetime_send= +; Send ISDN conected line information. +; +; block: Do not send any connected line information. +; connect: Send connected line information on initial connect. +; update: Same as connect but also send any updates during a call. +; Updates happen if the call is transferred. (Default) +; +;colp_send=update + ; Allow inband audio (progress) when a call is DISCONNECTed by the far end of a PRI ; ;inbanddisconnect=yes