summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-07-04 13:26:37 +0000
committerMatthew Jordan <mjordan@digium.com>2014-07-04 13:26:37 +0000
commit97834718c283d74e3571c1bf52d2840b93157cda (patch)
treea5887ff82e9f3d33c4cc1e64c0f9804dae47c295 /channels/chan_sip.c
parent3bd495a688199c2db5ebc397210f06191aa59581 (diff)
Remove many deprecated modules
Billing records are fair, To get paid is quite bright, You should really use ODBC; Good-bye cdr_sqlite. Microsoft did once push H.323, Hell, we all remember NetMeeting. But try to compile chan_h323 now And you will take quite a beating. The XMPP and SIP war was fierce, And in the distant fray Was birthed res_jabber/chan_jingle; But neither to stay. For everyone did care and chase what Google professed. "Free Internet Calling" was what devotees cried, But Google did change the specs so often That the developers were happy the day chan_gtalk died. And then there was that odd application Dedicated to the Polish tongue. app_saycountpl was subsumed by Say; One could say its bell was rung. To read and parse a file from the dialplan You could (I guess) use an application. app_readfile did fill that purpose, but I think A function is perhaps better in its creation. Barging is rude, I'm not sure why we do it. Inwardly, the caller will probably sigh. But if you really must do it, Don't use app_dahdibarge, use ChanSpy. We all despise the sound of tinny robots It makes our queues so cold. To control such an abomination It's better to not use Wait/SetMusicOnHold. It's often nice to know properties of a channel It makes our calls right We have a nice function called CHANNEL And so SIPCHANINFO is sent off into the night. And now things get odd; Apparently one could delimit with a colon Properties from the SIPPEER function! Commas are in; all others are done. Finally, a word on pipes and commas. We're sorry. We can't say it enough. But those compatibility options in asterisk.conf; To maintain them forever was just too tough. This patch removes: * cdr_sqlite * chan_gtalk * chan_jingle * chan_h323 * res_jabber * app_saycountpl * app_readfile * app_dahdibarge It removes the following applications/functions: * WaitMusicOnHold * SetMusicOnHold * SIPCHANINFO It removes the colon delimiter from the SIPPEER function. Finally, it also removes all compatibility options that were configurable from asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems. Review: https://reviewboard.asterisk.org/r/3698/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c119
1 files changed, 4 insertions, 115 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 35f5f5ef7..086913b41 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -111,7 +111,7 @@
* \todo Fix TCP/TLS handling in dialplan, SRV records, transfers and much more
* \todo Save TCP/TLS sessions in registry
* If someone registers a SIPS uri, this forces us to set up a TLS connection back.
- * \todo Add TCP/TLS information to function SIPPEER and SIPCHANINFO
+ * \todo Add TCP/TLS information to function SIPPEER and CHANNEL function
* \todo If tcpenable=yes, we must open a TCP socket on the same address as the IP for UDP.
* The tcpbindaddr config option should only be used to open ADDITIONAL ports
* So we should propably go back to
@@ -463,40 +463,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</syntax>
<description></description>
</function>
- <function name="SIPCHANINFO" language="en_US">
- <synopsis>
- Gets the specified SIP parameter from the current channel.
- </synopsis>
- <syntax>
- <parameter name="item" required="true">
- <enumlist>
- <enum name="peerip">
- <para>The IP address of the peer.</para>
- </enum>
- <enum name="recvip">
- <para>The source IP address of the peer.</para>
- </enum>
- <enum name="from">
- <para>The SIP URI from the <literal>From:</literal> header.</para>
- </enum>
- <enum name="uri">
- <para>The SIP URI from the <literal>Contact:</literal> header.</para>
- </enum>
- <enum name="useragent">
- <para>The Useragent header used by the peer.</para>
- </enum>
- <enum name="peername">
- <para>The name of the peer.</para>
- </enum>
- <enum name="t38passthrough">
- <para><literal>1</literal> if T38 is offered or enabled in this channel,
- otherwise <literal>0</literal>.</para>
- </enum>
- </enumlist>
- </parameter>
- </syntax>
- <description></description>
- </function>
<function name="CHECKSIPDOMAIN" language="en_US">
<synopsis>
Checks if domain is a local domain.
@@ -22390,15 +22356,11 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat
struct sip_peer *peer;
char *colname;
- if ((colname = strchr(data, ':'))) { /*! \todo Will be deprecated after 1.4 */
- static int deprecation_warning = 0;
- *colname++ = '\0';
- if (deprecation_warning++ % 10 == 0)
- ast_log(LOG_WARNING, "SIPPEER(): usage of ':' to separate arguments is deprecated. Please use ',' instead.\n");
- } else if ((colname = strchr(data, ',')))
+ if ((colname = strchr(data, ','))) {
*colname++ = '\0';
- else
+ } else {
colname = "ip";
+ }
if (!(peer = sip_find_peer(data, NULL, TRUE, FINDPEERS, FALSE, 0)))
return -1;
@@ -22495,77 +22457,6 @@ static struct ast_custom_function sippeer_function = {
.read = function_sippeer,
};
-/*! \brief ${SIPCHANINFO()} Dialplan function - reads sip channel data */
-static int function_sipchaninfo_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
-{
- struct sip_pvt *p;
- static int deprecated = 0;
-
- *buf = 0;
-
- if (!chan) {
- ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
- return -1;
- }
-
- if (!data) {
- ast_log(LOG_WARNING, "This function requires a parameter name.\n");
- return -1;
- }
-
- ast_channel_lock(chan);
- if (!IS_SIP_TECH(ast_channel_tech(chan))) {
- ast_log(LOG_WARNING, "This function can only be used on SIP channels.\n");
- ast_channel_unlock(chan);
- return -1;
- }
-
- if (deprecated++ % 20 == 0) {
- /* Deprecated in 1.6.1 */
- ast_log(LOG_WARNING, "SIPCHANINFO() is deprecated. Please transition to using CHANNEL().\n");
- }
-
- p = ast_channel_tech_pvt(chan);
-
- /* If there is no private structure, this channel is no longer alive */
- if (!p) {
- ast_channel_unlock(chan);
- return -1;
- }
-
- if (!strcasecmp(data, "peerip")) {
- ast_copy_string(buf, ast_sockaddr_stringify_addr(&p->sa), len);
- } else if (!strcasecmp(data, "recvip")) {
- ast_copy_string(buf, ast_sockaddr_stringify_addr(&p->recv), len);
- } else if (!strcasecmp(data, "from")) {
- ast_copy_string(buf, p->from, len);
- } else if (!strcasecmp(data, "uri")) {
- ast_copy_string(buf, p->uri, len);
- } else if (!strcasecmp(data, "useragent")) {
- ast_copy_string(buf, p->useragent, len);
- } else if (!strcasecmp(data, "peername")) {
- ast_copy_string(buf, p->peername, len);
- } else if (!strcasecmp(data, "t38passthrough")) {
- if ((p->t38.state == T38_DISABLED) || (p->t38.state == T38_REJECTED)) {
- ast_copy_string(buf, "0", len);
- } else { /* T38 is offered or enabled in this call */
- ast_copy_string(buf, "1", len);
- }
- } else {
- ast_channel_unlock(chan);
- return -1;
- }
- ast_channel_unlock(chan);
-
- return 0;
-}
-
-/*! \brief Structure to declare a dialplan function: SIPCHANINFO */
-static struct ast_custom_function sipchaninfo_function = {
- .name = "SIPCHANINFO",
- .read = function_sipchaninfo_read,
-};
-
/*! \brief update redirecting information for a channel based on headers
*
*/
@@ -34425,7 +34316,6 @@ static int load_module(void)
/* Register dialplan functions */
ast_custom_function_register(&sip_header_function);
ast_custom_function_register(&sippeer_function);
- ast_custom_function_register(&sipchaninfo_function);
ast_custom_function_register(&checksipdomain_function);
/* Register manager commands */
@@ -34518,7 +34408,6 @@ static int unload_module(void)
ast_msg_tech_unregister(&sip_msg_tech);
/* Unregister dial plan functions */
- ast_custom_function_unregister(&sipchaninfo_function);
ast_custom_function_unregister(&sippeer_function);
ast_custom_function_unregister(&sip_header_function);
ast_custom_function_unregister(&checksipdomain_function);