[asterisk-commits] oej: branch group/pine-multiple-externip-trunk r369919 - in /team/group/pine-...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Jul 11 07:03:11 CDT 2012
Author: oej
Date: Wed Jul 11 06:57:47 2012
New Revision: 369919
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369919
Log:
Trying to reset a branch after svnmerge totally trashed it. Happens quite often nowadays.
Added:
team/group/pine-multiple-externip-trunk/channels/chan_motif.c
- copied unchanged from r369910, trunk/channels/chan_motif.c
Modified:
team/group/pine-multiple-externip-trunk/ (props changed)
team/group/pine-multiple-externip-trunk/channels/chan_agent.c
team/group/pine-multiple-externip-trunk/channels/chan_dahdi.c
team/group/pine-multiple-externip-trunk/channels/chan_gtalk.c
team/group/pine-multiple-externip-trunk/channels/chan_iax2.c
team/group/pine-multiple-externip-trunk/channels/chan_local.c
team/group/pine-multiple-externip-trunk/channels/chan_sip.c
team/group/pine-multiple-externip-trunk/channels/sig_analog.c
team/group/pine-multiple-externip-trunk/channels/sig_pri.c
team/group/pine-multiple-externip-trunk/channels/sig_ss7.c
team/group/pine-multiple-externip-trunk/channels/sip/include/sip.h
Propchange: team/group/pine-multiple-externip-trunk/
('svnmerge-integrated' removed)
Modified: team/group/pine-multiple-externip-trunk/channels/chan_agent.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-trunk/channels/chan_agent.c?view=diff&rev=369919&r1=369918&r2=369919
==============================================================================
--- team/group/pine-multiple-externip-trunk/channels/chan_agent.c (original)
+++ team/group/pine-multiple-externip-trunk/channels/chan_agent.c Wed Jul 11 06:57:47 2012
@@ -2133,6 +2133,20 @@
!ast_strlen_zero(p->moh) ? strlen(p->moh) + 1 : 0);
if (p->loginstart == 0)
time(&p->loginstart);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when an Agent has logged in.</synopsis>
+ <syntax>
+ <parameter name="Agent">
+ <para>The name of the agent.</para>
+ </parameter>
+ </syntax>
+ <see-also>
+ <ref type="application">AgentLogin</ref>
+ <ref type="managerEvent">Agentlogoff</ref>
+ </see-also>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_AGENT, "Agentlogin",
"Agent: %s\r\n"
"Channel: %s\r\n"
@@ -2225,6 +2239,17 @@
logintime = time(NULL) - p->loginstart;
p->loginstart = 0;
ast_mutex_unlock(&p->lock);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when an Agent has logged off.</synopsis>
+ <syntax>
+ <xi:include xpointer="xpointer(/docs/managerEvent[@name='Agentlogin']/managerEventInstance/syntax/parameter[@name='Agent'])" />
+ </syntax>
+ <see-also>
+ <ref type="managerEvent">Agentlogin</ref>
+ </see-also>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_AGENT, "Agentlogoff",
"Agent: %s\r\n"
"Logintime: %ld\r\n"
Modified: team/group/pine-multiple-externip-trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-trunk/channels/chan_dahdi.c?view=diff&rev=369919&r1=369918&r2=369919
==============================================================================
--- team/group/pine-multiple-externip-trunk/channels/chan_dahdi.c (original)
+++ team/group/pine-multiple-externip-trunk/channels/chan_dahdi.c Wed Jul 11 06:57:47 2012
@@ -2175,6 +2175,11 @@
/* Real channel */
snprintf(ch_name, sizeof(ch_name), "%d", p->channel);
}
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when a DAHDI channel is created or an underlying technology is associated with a DAHDI channel.</synopsis>
+ </managerEventInstance>
+ ***/
ast_manager_event(chan, EVENT_FLAG_CALL, "DAHDIChannel",
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
@@ -3866,10 +3871,20 @@
if (report_alarms & REPORT_CHANNEL_ALARMS) {
ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", p->channel);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when an alarm is cleared on a DAHDI channel.</synopsis>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_SYSTEM, "AlarmClear", "Channel: %d\r\n", p->channel);
}
if (report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
ast_log(LOG_NOTICE, "Alarm cleared on span %d\n", p->span);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when an alarm is cleared on a DAHDI span.</synopsis>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_SYSTEM, "SpanAlarmClear", "Span: %d\r\n", p->span);
}
}
@@ -4151,7 +4166,7 @@
static void dahdi_r2_on_call_disconnect(openr2_chan_t *r2chan, openr2_call_disconnect_cause_t cause)
{
struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
- char cause_str[20];
+ char cause_str[50];
struct ast_control_pvt_cause_code *cause_code;
int datalen = sizeof(*cause_code);
@@ -4164,7 +4179,7 @@
return;
}
- snprintf(cause_str, sizeof(cause_str), "R2 DISCONNECT (%d)", dahdi_r2_cause_to_ast_cause(cause));
+ snprintf(cause_str, sizeof(cause_str), "R2 DISCONNECT (%s)", openr2_proto_get_disconnect_string(cause));
datalen += strlen(cause_str);
cause_code = alloca(datalen);
ast_copy_string(cause_code->chan_name, ast_channel_name(p->owner), AST_CHANNEL_NAME);
@@ -7972,6 +7987,11 @@
alarm_str = alarm2str(alms);
if (report_alarms & REPORT_CHANNEL_ALARMS) {
ast_log(LOG_WARNING, "Detected alarm on channel %d: %s\n", p->channel, alarm_str);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when an alarm is set on a DAHDI channel.</synopsis>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_SYSTEM, "Alarm",
"Alarm: %s\r\n"
"Channel: %d\r\n",
@@ -7980,6 +8000,11 @@
if (report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
ast_log(LOG_WARNING, "Detected alarm on span %d: %s\n", p->span, alarm_str);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when an alarm is set on a DAHDI span.</synopsis>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_SYSTEM, "SpanAlarm",
"Alarm: %s\r\n"
"Span: %d\r\n",
@@ -10027,6 +10052,19 @@
ast_verb(3, "%s DND on channel %d\n",
flag? "Enabled" : "Disabled",
dahdichan->channel);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when the Do Not Disturb state is changed on a DAHDI channel.</synopsis>
+ <syntax>
+ <parameter name="Status">
+ <enumlist>
+ <enum name="enabled"/>
+ <enum name="disabled"/>
+ </enumlist>
+ </parameter>
+ </syntax>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: DAHDI/%d\r\n"
"Status: %s\r\n", dahdichan->channel,
Modified: team/group/pine-multiple-externip-trunk/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-trunk/channels/chan_gtalk.c?view=diff&rev=369919&r1=369918&r2=369919
==============================================================================
--- team/group/pine-multiple-externip-trunk/channels/chan_gtalk.c (original)
+++ team/group/pine-multiple-externip-trunk/channels/chan_gtalk.c Wed Jul 11 06:57:47 2012
@@ -32,6 +32,7 @@
*/
/*** MODULEINFO
+ <defaultenabled>no</defaultenabled>
<depend>iksemel</depend>
<depend>res_jabber</depend>
<use type="external">openssl</use>
Modified: team/group/pine-multiple-externip-trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-trunk/channels/chan_iax2.c?view=diff&rev=369919&r1=369918&r2=369919
==============================================================================
--- team/group/pine-multiple-externip-trunk/channels/chan_iax2.c (original)
+++ team/group/pine-multiple-externip-trunk/channels/chan_iax2.c Wed Jul 11 06:57:47 2012
@@ -10188,54 +10188,35 @@
}
#endif
- if (iaxs[fr->callno]->owner && (fh->type == AST_FRAME_IAX || fh->type == AST_FRAME_CONTROL)) {
- struct ast_control_pvt_cause_code *cause_code;
- int data_size = sizeof(*cause_code);
- char subclass[40] = "";
-
- /* get subclass text */
- if (fh->type == AST_FRAME_IAX) {
- iax_frame_subclass2str(fh->csub, subclass, sizeof(subclass));
- } else {
- struct ast_frame tmp_frame = {0,};
- tmp_frame.frametype = fh->type;
- tmp_frame.subclass.integer = fh->csub;
- ast_frame_subclass2str(&tmp_frame, subclass, sizeof(subclass), NULL, 0);
- }
-
- /* add length of "IAX2 " */
- data_size += 5;
- if (fh->type == AST_FRAME_CONTROL) {
- /* add length of "Control " */
- data_size += 8;
- } else if (fh->csub == IAX_COMMAND_HANGUP
- || fh->csub == IAX_COMMAND_REJECT
- || fh->csub == IAX_COMMAND_REGREJ
- || fh->csub == IAX_COMMAND_TXREJ) {
- /* for IAX hangup frames, add length of () and number */
- data_size += 3;
- if (ies.causecode > 9) {
- data_size++;
- }
- if (ies.causecode > 99) {
- data_size++;
- }
- }
- /* add length of subclass */
- data_size += strlen(subclass);
-
- cause_code = alloca(data_size);
- ast_copy_string(cause_code->chan_name, ast_channel_name(iaxs[fr->callno]->owner), AST_CHANNEL_NAME);
-
- if (fh->type == AST_FRAME_IAX &&
+ if (iaxs[fr->callno]->owner && fh->type == AST_FRAME_IAX &&
(fh->csub == IAX_COMMAND_HANGUP
|| fh->csub == IAX_COMMAND_REJECT
|| fh->csub == IAX_COMMAND_REGREJ
|| fh->csub == IAX_COMMAND_TXREJ)) {
- snprintf(cause_code->code, data_size - sizeof(*cause_code) + 1, "IAX2 %s(%d)", subclass, ies.causecode);
- } else {
- snprintf(cause_code->code, data_size - sizeof(*cause_code) + 1, "IAX2 %s%s", (fh->type == AST_FRAME_CONTROL ? "Control " : ""), subclass);
- }
+ struct ast_control_pvt_cause_code *cause_code;
+ int data_size = sizeof(*cause_code);
+ char subclass[40] = "";
+
+ /* get subclass text */
+ iax_frame_subclass2str(fh->csub, subclass, sizeof(subclass));
+
+ /* add length of "IAX2 " */
+ data_size += 5;
+ /* for IAX hangup frames, add length of () and number */
+ data_size += 3;
+ if (ies.causecode > 9) {
+ data_size++;
+ }
+ if (ies.causecode > 99) {
+ data_size++;
+ }
+ /* add length of subclass */
+ data_size += strlen(subclass);
+
+ cause_code = alloca(data_size);
+ ast_copy_string(cause_code->chan_name, ast_channel_name(iaxs[fr->callno]->owner), AST_CHANNEL_NAME);
+
+ snprintf(cause_code->code, data_size - sizeof(*cause_code) + 1, "IAX2 %s(%d)", subclass, ies.causecode);
iax2_queue_control_data(fr->callno, AST_CONTROL_PVT_CAUSE_CODE, cause_code, data_size);
if (!iaxs[fr->callno]) {
Modified: team/group/pine-multiple-externip-trunk/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-trunk/channels/chan_local.c?view=diff&rev=369919&r1=369918&r2=369919
==============================================================================
--- team/group/pine-multiple-externip-trunk/channels/chan_local.c (original)
+++ team/group/pine-multiple-externip-trunk/channels/chan_local.c Wed Jul 11 06:57:47 2012
@@ -238,6 +238,12 @@
return -1;
}
+ if (!strcmp(write_info->function, "CHANNEL")
+ && !strncasecmp(write_info->data, "hangup_handler_", 15)) {
+ /* Block CHANNEL(hangup_handler_xxx) writes to the other local channel. */
+ return 0;
+ }
+
/* get the tech pvt */
if (!(p = ast_channel_tech_pvt(ast))) {
return -1;
@@ -949,6 +955,31 @@
goto return_cleanup;
}
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when two halves of a Local Channel form a bridge.</synopsis>
+ <syntax>
+ <parameter name="Channel1">
+ <para>The name of the Local Channel half that bridges to another channel.</para>
+ </parameter>
+ <parameter name="Channel2">
+ <para>The name of the Local Channel half that executes the dialplan.</para>
+ </parameter>
+ <parameter name="Context">
+ <para>The context in the dialplan that Channel2 starts in.</para>
+ </parameter>
+ <parameter name="Exten">
+ <para>The extension in the dialplan that Channel2 starts in.</para>
+ </parameter>
+ <parameter name="LocalOptimization">
+ <enumlist>
+ <enum name="Yes"/>
+ <enum name="No"/>
+ </enumlist>
+ </parameter>
+ </syntax>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_CALL, "LocalBridge",
"Channel1: %s\r\n"
"Channel2: %s\r\n"
Modified: team/group/pine-multiple-externip-trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-multiple-externip-trunk/channels/chan_sip.c?view=diff&rev=369919&r1=369918&r2=369919
==============================================================================
--- team/group/pine-multiple-externip-trunk/channels/chan_sip.c (original)
+++ team/group/pine-multiple-externip-trunk/channels/chan_sip.c Wed Jul 11 06:57:47 2012
@@ -1,209 +1,209 @@
/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2012, Digium, Inc.
- *
- * Mark Spencer <markster at digium.com>
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE file
- * at the top of the source tree.
- */
+* Asterisk -- An open source telephony toolkit.
+*
+* Copyright (C) 1999 - 2012, Digium, Inc.
+*
+* Mark Spencer <markster at digium.com>
+*
+* See http://www.asterisk.org for more information about
+* the Asterisk project. Please do not directly contact
+* any of the maintainers of this project for assistance;
+* the project provides a web site, mailing lists and IRC
+* channels for your use.
+*
+* This program is free software, distributed under the terms of
+* the GNU General Public License Version 2. See the LICENSE file
+* at the top of the source tree.
+*/
/*!
- * \file
- * \brief Implementation of Session Initiation Protocol
- *
- * \author Mark Spencer <markster at digium.com>
- *
- * See Also:
- * \arg \ref AstCREDITS
- *
- * Implementation of RFC 3261 - without S/MIME, and experimental TCP and TLS support
- * Configuration file \link Config_sip sip.conf \endlink
- *
- * ********** IMPORTANT *
- * \note TCP/TLS support is EXPERIMENTAL and WILL CHANGE. This applies to configuration
- * settings, dialplan commands and dialplans apps/functions
- * See \ref sip_tcp_tls
- *
- *
- * ******** General TODO:s
- * \todo Better support of forking
- * \todo VIA branch tag transaction checking
- * \todo Transaction support
- *
- * ******** Wishlist: Improvements
- * - Support of SIP domains for devices, so that we match on username at domain in the From: header
- * - Connect registrations with a specific device on the incoming call. It's not done
- * automatically in Asterisk
- *
- * \ingroup channel_drivers
- *
- * \par Overview of the handling of SIP sessions
- * The SIP channel handles several types of SIP sessions, or dialogs,
- * not all of them being "telephone calls".
- * - Incoming calls that will be sent to the PBX core
- * - Outgoing calls, generated by the PBX
- * - SIP subscriptions and notifications of states and voicemail messages
- * - SIP registrations, both inbound and outbound
- * - SIP peer management (peerpoke, OPTIONS)
- * - SIP text messages
- *
- * In the SIP channel, there's a list of active SIP dialogs, which includes
- * all of these when they are active. "sip show channels" in the CLI will
- * show most of these, excluding subscriptions which are shown by
- * "sip show subscriptions"
- *
- * \par incoming packets
- * Incoming packets are received in the monitoring thread, then handled by
- * sipsock_read() for udp only. In tcp, packets are read by the tcp_helper thread.
- * sipsock_read() function parses the packet and matches an existing
- * dialog or starts a new SIP dialog.
- *
- * sipsock_read sends the packet to handle_incoming(), that parses a bit more.
- * If it is a response to an outbound request, the packet is sent to handle_response().
- * If it is a request, handle_incoming() sends it to one of a list of functions
- * depending on the request type - INVITE, OPTIONS, REFER, BYE, CANCEL etc
- * sipsock_read locks the ast_channel if it exists (an active call) and
- * unlocks it after we have processed the SIP message.
- *
- * A new INVITE is sent to handle_request_invite(), that will end up
- * starting a new channel in the PBX, the new channel after that executing
- * in a separate channel thread. This is an incoming "call".
- * When the call is answered, either by a bridged channel or the PBX itself
- * the sip_answer() function is called.
- *
- * The actual media - Video or Audio - is mostly handled by the RTP subsystem
- * in rtp.c
- *
- * \par Outbound calls
- * Outbound calls are set up by the PBX through the sip_request_call()
- * function. After that, they are activated by sip_call().
- *
- * \par Hanging up
- * The PBX issues a hangup on both incoming and outgoing calls through
- * the sip_hangup() function
- */
+* \file
+* \brief Implementation of Session Initiation Protocol
+*
+* \author Mark Spencer <markster at digium.com>
+*
+* See Also:
+* \arg \ref AstCREDITS
+*
+* Implementation of RFC 3261 - without S/MIME, and experimental TCP and TLS support
+* Configuration file \link Config_sip sip.conf \endlink
+*
+* ********** IMPORTANT *
+* \note TCP/TLS support is EXPERIMENTAL and WILL CHANGE. This applies to configuration
+* settings, dialplan commands and dialplans apps/functions
+* See \ref sip_tcp_tls
+*
+*
+* ******** General TODO:s
+* \todo Better support of forking
+* \todo VIA branch tag transaction checking
+* \todo Transaction support
+*
+* ******** Wishlist: Improvements
+* - Support of SIP domains for devices, so that we match on username at domain in the From: header
+* - Connect registrations with a specific device on the incoming call. It's not done
+* automatically in Asterisk
+*
+* \ingroup channel_drivers
+*
+* \par Overview of the handling of SIP sessions
+* The SIP channel handles several types of SIP sessions, or dialogs,
+* not all of them being "telephone calls".
+* - Incoming calls that will be sent to the PBX core
+* - Outgoing calls, generated by the PBX
+* - SIP subscriptions and notifications of states and voicemail messages
+* - SIP registrations, both inbound and outbound
+* - SIP peer management (peerpoke, OPTIONS)
+* - SIP text messages
+*
+* In the SIP channel, there's a list of active SIP dialogs, which includes
+* all of these when they are active. "sip show channels" in the CLI will
+* show most of these, excluding subscriptions which are shown by
+* "sip show subscriptions"
+*
+* \par incoming packets
+* Incoming packets are received in the monitoring thread, then handled by
+* sipsock_read() for udp only. In tcp, packets are read by the tcp_helper thread.
+* sipsock_read() function parses the packet and matches an existing
+* dialog or starts a new SIP dialog.
+*
+* sipsock_read sends the packet to handle_incoming(), that parses a bit more.
+* If it is a response to an outbound request, the packet is sent to handle_response().
+* If it is a request, handle_incoming() sends it to one of a list of functions
+* depending on the request type - INVITE, OPTIONS, REFER, BYE, CANCEL etc
+* sipsock_read locks the ast_channel if it exists (an active call) and
+* unlocks it after we have processed the SIP message.
+*
+* A new INVITE is sent to handle_request_invite(), that will end up
+* starting a new channel in the PBX, the new channel after that executing
+* in a separate channel thread. This is an incoming "call".
+* When the call is answered, either by a bridged channel or the PBX itself
+* the sip_answer() function is called.
+*
+* The actual media - Video or Audio - is mostly handled by the RTP subsystem
+* in rtp.c
+*
+* \par Outbound calls
+* Outbound calls are set up by the PBX through the sip_request_call()
+* function. After that, they are activated by sip_call().
+*
+* \par Hanging up
+* The PBX issues a hangup on both incoming and outgoing calls through
+* the sip_hangup() function
+*/
/*!
- * \page sip_tcp_tls SIP TCP and TLS support
- *
- * \par tcpfixes TCP implementation changes needed
- * \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 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
- * bindaddr= the default address to bind to. If tcpenable=yes, then bind this to both udp and TCP
- * if tlsenable=yes, open TLS port (provided we also have cert)
- * tcpbindaddr = extra address for additional TCP connections
- * tlsbindaddr = extra address for additional TCP/TLS connections
- * udpbindaddr = extra address for additional UDP connections
- * These three options should take multiple IP/port pairs
- * Note: Since opening additional listen sockets is a *new* feature we do not have today
- * the XXXbindaddr options needs to be disabled until we have support for it
- *
- * \todo re-evaluate the transport= setting in sip.conf. This is right now not well
- * thought of. If a device in sip.conf contacts us via TCP, we should not switch transport,
- * even if udp is the configured first transport.
- *
- * \todo Be prepared for one outbound and another incoming socket per pvt. This applies
- * specially to communication with other peers (proxies).
- * \todo We need to test TCP sessions with SIP proxies and in regards
- * to the SIP outbound specs.
- * \todo ;transport=tls was deprecated in RFC3261 and should not be used at all. See section 26.2.2.
- *
- * \todo If the message is smaller than the given Content-length, the request should get a 400 Bad request
- * message. If it's a response, it should be dropped. (RFC 3261, Section 18.3)
- * \todo Since we have had multidomain support in Asterisk for quite a while, we need to support
- * multiple domains in our TLS implementation, meaning one socket and one cert per domain
- * \todo Selection of transport for a request needs to be done after we've parsed all route headers,
- * also considering outbound proxy options.
- * First request: Outboundproxy, routes, (reg contact or URI. If URI doesn't have port: DNS naptr, srv, AAA)
- * Intermediate requests: Outboundproxy(only when forced), routes, contact/uri
- * DNS naptr support is crucial. A SIP uri might lead to a TLS connection.
- * Also note that due to outbound proxy settings, a SIPS uri might have to be sent on UDP (not to recommend though)
- * \todo Default transports are set to UDP, which cause the wrong behaviour when contacting remote
- * devices directly from the dialplan. UDP is only a fallback if no other method works,
- * in order to be compatible with RFC2543 (SIP/1.0) devices. For transactions that exceed the
- * MTU (like INIVTE with video, audio and RTT) TCP should be preferred.
- *
- * When dialling unconfigured peers (with no port number) or devices in external domains
- * NAPTR records MUST be consulted to find configured transport. If they are not found,
- * SRV records for both TCP and UDP should be checked. If there's a record for TCP, use that.
- * If there's no record for TCP, then use UDP as a last resort. If there's no SRV records,
- * \note this only applies if there's no outbound proxy configured for the session. If an outbound
- * proxy is configured, these procedures might apply for locating the proxy and determining
- * the transport to use for communication with the proxy.
- * \par Other bugs to fix ----
- * __set_address_from_contact(const char *fullcontact, struct sockaddr_in *sin, int tcp)
- * - sets TLS port as default for all TCP connections, unless other port is given in contact.
- * parse_register_contact(struct sip_pvt *pvt, struct sip_peer *peer, struct sip_request *req)
- * - assumes that the contact the UA registers is using the same transport as the REGISTER request, which is
- * a bad guess.
- * - Does not save any information about TCP/TLS connected devices, which is a severe BUG, as discussed on the mailing list.
- * get_destination(struct sip_pvt *p, struct sip_request *oreq)
- * - Doesn't store the information that we got an incoming SIPS request in the channel, so that
- * we can require a secure signalling path OUT of Asterisk (on SIP or IAX2). Possibly, the call should
- * fail on in-secure signalling paths if there's no override in our configuration. At least, provide a
- * channel variable in the dialplan.
- * get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoing_req)
- * - As above, if we have a SIPS: uri in the refer-to header
- * - Does not check transport in refer_to uri.
- */
+* \page sip_tcp_tls SIP TCP and TLS support
+*
+* \par tcpfixes TCP implementation changes needed
+* \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 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
+* bindaddr= the default address to bind to. If tcpenable=yes, then bind this to both udp and TCP
+* if tlsenable=yes, open TLS port (provided we also have cert)
+* tcpbindaddr = extra address for additional TCP connections
+* tlsbindaddr = extra address for additional TCP/TLS connections
+* udpbindaddr = extra address for additional UDP connections
+* These three options should take multiple IP/port pairs
+* Note: Since opening additional listen sockets is a *new* feature we do not have today
+* the XXXbindaddr options needs to be disabled until we have support for it
+*
+* \todo re-evaluate the transport= setting in sip.conf. This is right now not well
+* thought of. If a device in sip.conf contacts us via TCP, we should not switch transport,
+* even if udp is the configured first transport.
+*
+* \todo Be prepared for one outbound and another incoming socket per pvt. This applies
+* specially to communication with other peers (proxies).
+* \todo We need to test TCP sessions with SIP proxies and in regards
+* to the SIP outbound specs.
+* \todo ;transport=tls was deprecated in RFC3261 and should not be used at all. See section 26.2.2.
+*
+* \todo If the message is smaller than the given Content-length, the request should get a 400 Bad request
+* message. If it's a response, it should be dropped. (RFC 3261, Section 18.3)
+* \todo Since we have had multidomain support in Asterisk for quite a while, we need to support
+* multiple domains in our TLS implementation, meaning one socket and one cert per domain
+* \todo Selection of transport for a request needs to be done after we've parsed all route headers,
+* also considering outbound proxy options.
+* First request: Outboundproxy, routes, (reg contact or URI. If URI doesn't have port: DNS naptr, srv, AAA)
+* Intermediate requests: Outboundproxy(only when forced), routes, contact/uri
+* DNS naptr support is crucial. A SIP uri might lead to a TLS connection.
+* Also note that due to outbound proxy settings, a SIPS uri might have to be sent on UDP (not to recommend though)
+* \todo Default transports are set to UDP, which cause the wrong behaviour when contacting remote
+* devices directly from the dialplan. UDP is only a fallback if no other method works,
+* in order to be compatible with RFC2543 (SIP/1.0) devices. For transactions that exceed the
+* MTU (like INIVTE with video, audio and RTT) TCP should be preferred.
+*
+* When dialling unconfigured peers (with no port number) or devices in external domains
+* NAPTR records MUST be consulted to find configured transport. If they are not found,
+* SRV records for both TCP and UDP should be checked. If there's a record for TCP, use that.
+* If there's no record for TCP, then use UDP as a last resort. If there's no SRV records,
+* \note this only applies if there's no outbound proxy configured for the session. If an outbound
+* proxy is configured, these procedures might apply for locating the proxy and determining
+* the transport to use for communication with the proxy.
+* \par Other bugs to fix ----
+* __set_address_from_contact(const char *fullcontact, struct sockaddr_in *sin, int tcp)
+* - sets TLS port as default for all TCP connections, unless other port is given in contact.
+* parse_register_contact(struct sip_pvt *pvt, struct sip_peer *peer, struct sip_request *req)
+* - assumes that the contact the UA registers is using the same transport as the REGISTER request, which is
+* a bad guess.
+* - Does not save any information about TCP/TLS connected devices, which is a severe BUG, as discussed on the mailing list.
+* get_destination(struct sip_pvt *p, struct sip_request *oreq)
+* - Doesn't store the information that we got an incoming SIPS request in the channel, so that
+* we can require a secure signalling path OUT of Asterisk (on SIP or IAX2). Possibly, the call should
+* fail on in-secure signalling paths if there's no override in our configuration. At least, provide a
+* channel variable in the dialplan.
+* get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoing_req)
+* - As above, if we have a SIPS: uri in the refer-to header
+* - Does not check transport in refer_to uri.
+*/
/*** MODULEINFO
- <use type="module">res_crypto</use>
- <depend>chan_local</depend>
- <support_level>core</support_level>
- ***/
+<use type="module">res_crypto</use>
+<depend>chan_local</depend>
+<support_level>core</support_level>
+***/
/*! \page sip_session_timers SIP Session Timers in Asterisk Chan_sip
- The SIP Session-Timers is an extension of the SIP protocol that allows end-points and proxies to
- refresh a session periodically. The sessions are kept alive by sending a RE-INVITE or UPDATE
- request at a negotiated interval. If a session refresh fails then all the entities that support Session-
- Timers clear their internal session state. In addition, UAs generate a BYE request in order to clear
- the state in the proxies and the remote UA (this is done for the benefit of SIP entities in the path
- that do not support Session-Timers).
-
- The Session-Timers can be configured on a system-wide, per-user, or per-peer basis. The peruser/
- per-peer settings override the global settings. The following new parameters have been
- added to the sip.conf file.
- session-timers=["accept", "originate", "refuse"]
- session-expires=[integer]
- session-minse=[integer]
- session-refresher=["uas", "uac"]
-
- The session-timers parameter in sip.conf defines the mode of operation of SIP session-timers feature in
- Asterisk. The Asterisk can be configured in one of the following three modes:
-
- 1. Accept :: In the "accept" mode, the Asterisk server honors session-timers requests
- made by remote end-points. A remote end-point can request Asterisk to engage
- session-timers by either sending it an INVITE request with a "Supported: timer"
- header in it or by responding to Asterisk's INVITE with a 200 OK that contains
- Session-Expires: header in it. In this mode, the Asterisk server does not
- request session-timers from remote end-points. This is the default mode.
- 2. Originate :: In the "originate" mode, the Asterisk server requests the remote
- end-points to activate session-timers in addition to honoring such requests
- made by the remote end-pints. In order to get as much protection as possible
- against hanging SIP channels due to network or end-point failures, Asterisk
- resends periodic re-INVITEs even if a remote end-point does not support
- the session-timers feature.
- 3. Refuse :: In the "refuse" mode, Asterisk acts as if it does not support session-
- timers for inbound or outbound requests. If a remote end-point requests
- session-timers in a dialog, then Asterisk ignores that request unless it's
- noted as a requirement (Require: header), in which case the INVITE is
- rejected with a 420 Bad Extension response.
+The SIP Session-Timers is an extension of the SIP protocol that allows end-points and proxies to
+refresh a session periodically. The sessions are kept alive by sending a RE-INVITE or UPDATE
+request at a negotiated interval. If a session refresh fails then all the entities that support Session-
+Timers clear their internal session state. In addition, UAs generate a BYE request in order to clear
+the state in the proxies and the remote UA (this is done for the benefit of SIP entities in the path
+that do not support Session-Timers).
+
+The Session-Timers can be configured on a system-wide, per-user, or per-peer basis. The peruser/
+per-peer settings override the global settings. The following new parameters have been
+added to the sip.conf file.
+ session-timers=["accept", "originate", "refuse"]
+ session-expires=[integer]
+ session-minse=[integer]
+ session-refresher=["uas", "uac"]
+
+The session-timers parameter in sip.conf defines the mode of operation of SIP session-timers feature in
+Asterisk. The Asterisk can be configured in one of the following three modes:
+
+1. Accept :: In the "accept" mode, the Asterisk server honors session-timers requests
+ made by remote end-points. A remote end-point can request Asterisk to engage
+ session-timers by either sending it an INVITE request with a "Supported: timer"
+ header in it or by responding to Asterisk's INVITE with a 200 OK that contains
+ Session-Expires: header in it. In this mode, the Asterisk server does not
+ request session-timers from remote end-points. This is the default mode.
+2. Originate :: In the "originate" mode, the Asterisk server requests the remote
+ end-points to activate session-timers in addition to honoring such requests
+ made by the remote end-pints. In order to get as much protection as possible
+ against hanging SIP channels due to network or end-point failures, Asterisk
+ resends periodic re-INVITEs even if a remote end-point does not support
+ the session-timers feature.
+3. Refuse :: In the "refuse" mode, Asterisk acts as if it does not support session-
+ timers for inbound or outbound requests. If a remote end-point requests
+ session-timers in a dialog, then Asterisk ignores that request unless it's
+ noted as a requirement (Require: header), in which case the INVITE is
+ rejected with a 420 Bad Extension response.
*/
@@ -219,15 +219,15 @@
#include "asterisk/network.h"
#include "asterisk/paths.h" /* need ast_config_AST_SYSTEM_NAME */
/*
- Uncomment the define below, if you are having refcount related memory leaks.
- With this uncommented, this module will generate a file, /tmp/refs, which contains
- a history of the ao2_ref() calls. To be useful, all calls to ao2_* functions should
- be modified to ao2_t_* calls, and include a tag describing what is happening with
- enough detail, to make pairing up a reference count increment with its corresponding decrement.
- The refcounter program in utils/ can be invaluable in highlighting objects that are not
- balanced, along with the complete history for that object.
- In normal operation, the macros defined will throw away the tags, so they do not
- affect the speed of the program at all. They can be considered to be documentation.
+Uncomment the define below, if you are having refcount related memory leaks.
+With this uncommented, this module will generate a file, /tmp/refs, which contains
+a history of the ao2_ref() calls. To be useful, all calls to ao2_* functions should
+be modified to ao2_t_* calls, and include a tag describing what is happening with
+enough detail, to make pairing up a reference count increment with its corresponding decrement.
+The refcounter program in utils/ can be invaluable in highlighting objects that are not
+balanced, along with the complete history for that object.
+In normal operation, the macros defined will throw away the tags, so they do not
+affect the speed of the program at all. They can be considered to be documentation.
*/
/* #define REF_DEBUG 1 */
@@ -281,298 +281,298 @@
#include "asterisk/sip_api.h"
/*** DOCUMENTATION
- <application name="SIPDtmfMode" language="en_US">
- <synopsis>
- Change the dtmfmode for a SIP call.
- </synopsis>
- <syntax>
- <parameter name="mode" required="true">
- <enumlist>
- <enum name="inband" />
- <enum name="info" />
- <enum name="rfc2833" />
- </enumlist>
- </parameter>
- </syntax>
- <description>
- <para>Changes the dtmfmode for a SIP call.</para>
- </description>
- </application>
- <application name="SIPAddHeader" language="en_US">
- <synopsis>
- Add a SIP header to the outbound call.
- </synopsis>
- <syntax argsep=":">
- <parameter name="Header" required="true" />
- <parameter name="Content" required="true" />
- </syntax>
- <description>
- <para>Adds a header to a SIP call placed with DIAL.</para>
- <para>Remember to use the X-header if you are adding non-standard SIP
- headers, like <literal>X-Asterisk-Accountcode:</literal>. Use this with care.
- Adding the wrong headers may jeopardize the SIP dialog.</para>
- <para>Always returns <literal>0</literal>.</para>
- </description>
- </application>
- <application name="SIPRemoveHeader" language="en_US">
- <synopsis>
- Remove SIP headers previously added with SIPAddHeader
- </synopsis>
- <syntax>
- <parameter name="Header" required="false" />
- </syntax>
- <description>
- <para>SIPRemoveHeader() allows you to remove headers which were previously
- added with SIPAddHeader(). If no parameter is supplied, all previously added
- headers will be removed. If a parameter is supplied, only the matching headers
- will be removed.</para>
- <para>For example you have added these 2 headers:</para>
- <para>SIPAddHeader(P-Asserted-Identity: sip:foo at bar);</para>
- <para>SIPAddHeader(P-Preferred-Identity: sip:bar at foo);</para>
- <para></para>
- <para>// remove all headers</para>
- <para>SIPRemoveHeader();</para>
- <para>// remove all P- headers</para>
- <para>SIPRemoveHeader(P-);</para>
- <para>// remove only the PAI header (note the : at the end)</para>
- <para>SIPRemoveHeader(P-Asserted-Identity:);</para>
- <para></para>
- <para>Always returns <literal>0</literal>.</para>
- </description>
- </application>
- <application name="SIPSendCustomINFO" language="en_US">
- <synopsis>
- Send a custom INFO frame on specified channels.
- </synopsis>
- <syntax>
- <parameter name="Data" required="true" />
- <parameter name="UserAgent" required="false" />
- </syntax>
- <description>
- <para>SIPSendCustomINFO() allows you to send a custom INFO message on all
- active SIP channels or on channels with the specified User Agent. This
- application is only available if TEST_FRAMEWORK is defined.</para>
- </description>
- </application>
- <function name="SIP_HEADER" language="en_US">
- <synopsis>
- Gets the specified SIP header from an incoming INVITE message.
- </synopsis>
- <syntax>
- <parameter name="name" required="true" />
- <parameter name="number">
- <para>If not specified, defaults to <literal>1</literal>.</para>
- </parameter>
- </syntax>
- <description>
[... 8111 lines stripped ...]
More information about the asterisk-commits
mailing list