aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-04 20:30:48 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-04 20:30:48 +0000
commit6df0404cd7ac4ef942c99b549279562ad16acb98 (patch)
treec46af10321e9d849a4a801c16256a042ab8967c7 /channels/sig_pri.c
parent87b28286de2adddf6b232033f20d590dae45c93c (diff)
Add ISDN display ie text handling options to chan_dahdi.conf.
The display ie handling can be controlled independently in the send and receive directions with the following options: * Block display text data. * Use display text in SETUP/CONNECT messages for name. * Use display text for COLP name updates (FACILITY/NOTIFY as appropriate). * Pass arbitrary display text during a call. Sent in INFORMATION messages. Received from any message that the display text was not used as a name. If the display options are not set then the options default to legacy behavior. The arbitrary display text is exchanged between bridged channels using the AST_FRAME_TEXT frame type. To send display text from the dialplan use the SendText() application when the arbitrary display text option is enabled. JIRA SWP-2688 JIRA ABE-2693 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306396 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index e66068bca..ff700c087 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -4084,6 +4084,31 @@ static void sig_pri_handle_subcmds(struct sig_pri_span *pri, int chanpos, int ev
/* Ignore for now. */
break;
#endif /* defined(HAVE_PRI_MCID) */
+#if defined(HAVE_PRI_DISPLAY_TEXT)
+ case PRI_SUBCMD_DISPLAY_TEXT:
+ if (event_id != PRI_EVENT_RING) {
+ /*
+ * This display text was not from a SETUP message. We can do
+ * something with this display text string.
+ */
+ sig_pri_lock_owner(pri, chanpos);
+ owner = pri->pvts[chanpos]->owner;
+ if (owner) {
+ struct ast_frame f;
+
+ /* Pass the display text to the peer channel. */
+ memset(&f, 0, sizeof(f));
+ f.frametype = AST_FRAME_TEXT;
+ f.subclass.integer = 0;
+ f.offset = 0;
+ f.data.ptr = &subcmd->u.display.text;
+ f.datalen = subcmd->u.display.length + 1;
+ ast_queue_frame(owner, &f);
+ ast_channel_unlock(owner);
+ }
+ }
+ break;
+#endif /* defined(HAVE_PRI_DISPLAY_TEXT) */
default:
ast_debug(2,
"Unknown call subcommand(%d) in %s event on channel %d/%d on span %d.\n",
@@ -8171,6 +8196,10 @@ int sig_pri_start_pri(struct sig_pri_span *pri)
#if defined(HAVE_PRI_MCID)
pri_mcid_enable(pri->pri, 1);
#endif /* defined(HAVE_PRI_MCID) */
+#if defined(HAVE_PRI_DISPLAY_TEXT)
+ pri_display_options_send(pri->pri, pri->display_flags_send);
+ pri_display_options_receive(pri->pri, pri->display_flags_receive);
+#endif /* defined(HAVE_PRI_DISPLAY_TEXT) */
pri->resetpos = -1;
if (ast_pthread_create_background(&pri->master, NULL, pri_dchannel, pri)) {
@@ -8383,6 +8412,31 @@ void sig_pri_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, str
}
}
+#if defined(HAVE_PRI_DISPLAY_TEXT)
+/*!
+ * \brief Send display text.
+ * \since 1.10
+ *
+ * \param p Channel to send text over
+ * \param text Text to send.
+ *
+ * \return Nothing
+ */
+void sig_pri_sendtext(struct sig_pri_chan *p, const char *text)
+{
+ struct pri_subcmd_display_txt display;
+
+ if (p->pri && p->pri->pri) {
+ ast_copy_string(display.text, text, sizeof(display.text));
+ display.length = strlen(display.text);
+ display.char_set = 0;/* unknown(0) */
+ pri_grab(p, p->pri);
+ pri_display_text(p->pri->pri, p->call, &display);
+ pri_rel(p->pri);
+ }
+}
+#endif /* defined(HAVE_PRI_DISPLAY_TEXT) */
+
#if defined(HAVE_PRI_CCSS)
/*!
* \brief PRI CC agent initialization.