[asterisk-commits] moy: branch moy/webrtc-11 r409360 - in /team/moy/webrtc-11: ./ apps/ channels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Mar 2 19:02:35 CST 2014
Author: moy
Date: Sun Mar 2 19:02:31 2014
New Revision: 409360
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=409360
Log:
Merged r408853:r409344 from /branches/11 to /team/moy/webrtc-11
Modified:
team/moy/webrtc-11/ (props changed)
team/moy/webrtc-11/Makefile.rules
team/moy/webrtc-11/apps/app_queue.c
team/moy/webrtc-11/channels/chan_sip.c
team/moy/webrtc-11/configs/res_fax.conf.sample
team/moy/webrtc-11/configs/voicemail.conf.sample
team/moy/webrtc-11/include/asterisk/rtp_engine.h
team/moy/webrtc-11/main/rtp_engine.c
team/moy/webrtc-11/res/res_fax.c
team/moy/webrtc-11/res/res_rtp_asterisk.c
team/moy/webrtc-11/utils/astman.c
Propchange: team/moy/webrtc-11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Propchange: team/moy/webrtc-11/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Mar 2 19:02:31 2014
@@ -1,1 +1,1 @@
-/branches/11:400822-408853
+/branches/11:400822-409344
Modified: team/moy/webrtc-11/Makefile.rules
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/Makefile.rules?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/Makefile.rules (original)
+++ team/moy/webrtc-11/Makefile.rules Sun Mar 2 19:02:31 2014
@@ -35,7 +35,7 @@
CMD_PREFIX=
endif
-OPTIMIZE?=-O6
+OPTIMIZE?=-O3
ifneq ($(findstring darwin,$(OSARCH)),)
ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
# Snow Leopard/Lion has an issue with this optimization flag on large files (like chan_sip)
Modified: team/moy/webrtc-11/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/apps/app_queue.c?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/apps/app_queue.c (original)
+++ team/moy/webrtc-11/apps/app_queue.c Sun Mar 2 19:02:31 2014
@@ -6276,22 +6276,25 @@
ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"), "%s", S_OR(reason, ""));
- /*** DOCUMENTATION
- <managerEventInstance>
- <synopsis>Raised when a member is paused/unpaused in the queue with a reason.</synopsis>
- <syntax>
- <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='Queue'])" />
- <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='Location'])" />
- <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='MemberName'])" />
- <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='Paused'])" />
- </syntax>
- <see-also>
- <ref type="application">PauseQueueMember</ref>
- <ref type="application">UnPauseQueueMember</ref>
- </see-also>
- </managerEventInstance>
- ***/
if (!ast_strlen_zero(reason)) {
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when a member is paused/unpaused in the queue with a reason.</synopsis>
+ <syntax>
+ <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='Queue'])" />
+ <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='Location'])" />
+ <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='MemberName'])" />
+ <xi:include xpointer="xpointer(/docs/managerEvent[@name='QueueMemberStatus']/managerEventInstance/syntax/parameter[@name='Paused'])" />
+ <parameter name="Reason">
+ <para>The reason given for pausing or unpausing a queue member.</para>
+ </parameter>
+ </syntax>
+ <see-also>
+ <ref type="application">PauseQueueMember</ref>
+ <ref type="application">UnPauseQueueMember</ref>
+ </see-also>
+ </managerEventInstance>
+ ***/
manager_event(EVENT_FLAG_AGENT, "QueueMemberPaused",
"Queue: %s\r\n"
"Location: %s\r\n"
Modified: team/moy/webrtc-11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/channels/chan_sip.c?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/channels/chan_sip.c (original)
+++ team/moy/webrtc-11/channels/chan_sip.c Sun Mar 2 19:02:31 2014
@@ -7051,10 +7051,12 @@
ast_debug(4, "SIP Transfer: Not hanging up right now... Rescheduling hangup for %s.\n", p->callid);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
ast_clear_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER); /* Really hang up next time */
- ast_channel_tech_pvt_set(p->owner, dialog_unref(ast_channel_tech_pvt(p->owner), "unref p->owner->tech_pvt"));
- sip_pvt_lock(p);
- p->owner = NULL; /* Owner will be gone after we return, so take it away */
- sip_pvt_unlock(p);
+ if (p->owner) {
+ ast_channel_tech_pvt_set(p->owner, dialog_unref(ast_channel_tech_pvt(p->owner), "unref p->owner->tech_pvt"));
+ sip_pvt_lock(p);
+ p->owner = NULL; /* Owner will be gone after we return, so take it away */
+ sip_pvt_unlock(p);
+ }
ast_module_unref(ast_module_info->self);
return 0;
}
@@ -7083,7 +7085,7 @@
stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
- append_history(p, needcancel ? "Cancel" : "Hangup", "Cause %s", p->owner ? ast_cause2str(p->hangupcause) : "Unknown");
+ append_history(p, needcancel ? "Cancel" : "Hangup", "Cause %s", ast_cause2str(p->hangupcause));
/* Disconnect */
disable_dsp_detect(p);
@@ -7585,7 +7587,9 @@
AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
parameters.max_ifp = ast_udptl_get_far_max_ifp(p->udptl);
parameters.request_response = AST_T38_REQUEST_NEGOTIATE;
- ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, ¶meters, sizeof(parameters));
+ if (p->owner) {
+ ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, ¶meters, sizeof(parameters));
+ }
/* we need to return a positive value here, so that applications that
* send this request can determine conclusively whether it was accepted or not...
* older versions of chan_sip would just silently accept it and return zero.
@@ -12506,9 +12510,9 @@
{
struct ast_str *tmp = ast_str_alloca(256);
char tmp2[256];
- char *lid_num = NULL;
- char *lid_name = NULL;
- int lid_pres = AST_PRES_NUMBER_NOT_AVAILABLE;
+ char *lid_num;
+ char *lid_name;
+ int lid_pres;
const char *fromdomain;
const char *privacy = NULL;
const char *screen = NULL;
@@ -12519,22 +12523,20 @@
return 0;
}
- if (p->owner) {
- connected_id = ast_channel_connected_effective_id(p->owner);
-
- if (connected_id.number.valid) {
- lid_num = connected_id.number.str;
- }
- if (connected_id.name.valid) {
- lid_name = connected_id.name.str;
- }
- lid_pres = ast_party_id_presentation(&connected_id);
- }
-
- if (ast_strlen_zero(lid_num))
+ if (!p->owner) {
return 0;
- if (ast_strlen_zero(lid_name))
+ }
+ connected_id = ast_channel_connected_effective_id(p->owner);
+ lid_num = S_COR(connected_id.number.valid, connected_id.number.str, NULL);
+ if (!lid_num) {
+ return 0;
+ }
+ lid_name = S_COR(connected_id.name.valid, connected_id.name.str, NULL);
+ if (!lid_name) {
lid_name = lid_num;
+ }
+ lid_pres = ast_party_id_presentation(&connected_id);
+
fromdomain = S_OR(p->fromdomain, ast_sockaddr_stringify_host_remote(&p->ourip));
lid_num = ast_uri_encode(lid_num, tmp2, sizeof(tmp2), ast_uri_sip_user);
@@ -17897,13 +17899,15 @@
}
/* Determine transfer context */
- if (transferer->owner) /* Mimic behaviour in res_features.c */
+ if (transferer->owner) {
+ /* By default, use the context in the channel sending the REFER */
transfer_context = pbx_builtin_getvar_helper(transferer->owner, "TRANSFER_CONTEXT");
-
- /* By default, use the context in the channel sending the REFER */
+ if (ast_strlen_zero(transfer_context)) {
+ transfer_context = ast_channel_macrocontext(transferer->owner);
+ }
+ }
if (ast_strlen_zero(transfer_context)) {
- transfer_context = S_OR(ast_channel_macrocontext(transferer->owner),
- S_OR(transferer->context, sip_cfg.default_context));
+ transfer_context = S_OR(transferer->context, sip_cfg.default_context);
}
ast_string_field_set(refer, refer_to_context, transfer_context);
@@ -17957,14 +17961,18 @@
if (sip_debug_test_pvt(p))
ast_verbose("Looking for %s in %s\n", c, p->context);
- if (p->owner) /* Mimic behaviour in res_features.c */
+ /* Determine transfer context */
+ if (p->owner) {
+ /* By default, use the context in the channel sending the REFER */
transfer_context = pbx_builtin_getvar_helper(p->owner, "TRANSFER_CONTEXT");
-
- /* By default, use the context in the channel sending the REFER */
+ if (ast_strlen_zero(transfer_context)) {
+ transfer_context = ast_channel_macrocontext(p->owner);
+ }
+ }
if (ast_strlen_zero(transfer_context)) {
- transfer_context = S_OR(ast_channel_macrocontext(p->owner),
- S_OR(p->context, sip_cfg.default_context));
- }
+ transfer_context = S_OR(p->context, sip_cfg.default_context);
+ }
+
if (ast_exists_extension(NULL, transfer_context, c, 1, NULL)) {
/* This is a blind transfer */
ast_debug(1, "SIP Bye-also transfer to Extension %s@%s \n", c, transfer_context);
@@ -22868,9 +22876,11 @@
/* This 200 OK's SDP is not acceptable, so we need to ack, then hangup */
/* For re-invites, we try to recover */
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
- ast_channel_hangupcause_set(p->owner, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
p->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
- sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+ if (p->owner) {
+ ast_channel_hangupcause_set(p->owner, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+ sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+ }
}
}
ast_rtp_instance_activate(p->rtp);
@@ -25453,12 +25463,6 @@
ast_debug(2, "No SDP in Invite, third party call control\n");
}
- /* Queue NULL frame to prod ast_rtp_bridge if appropriate */
- /* This seems redundant ... see !p-owner above */
- if (p->owner)
- ast_queue_frame(p->owner, &ast_null_frame);
-
-
/* Initialize the context if it hasn't been already */
if (ast_strlen_zero(p->context))
ast_string_field_set(p, context, sip_cfg.default_context);
@@ -29951,7 +29955,7 @@
if (sip_cfg.callevents)
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
- p->owner? ast_channel_name(p->owner) : "", "SIP", p->callid, p->fullcontact, p->peername);
+ p->owner ? ast_channel_name(p->owner) : "", "SIP", p->callid, p->fullcontact, p->peername);
sip_pvt_unlock(p);
if (!tmpc) {
dialog_unlink_all(p);
Modified: team/moy/webrtc-11/configs/res_fax.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/configs/res_fax.conf.sample?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/configs/res_fax.conf.sample (original)
+++ team/moy/webrtc-11/configs/res_fax.conf.sample Sun Mar 2 19:02:31 2014
@@ -4,12 +4,12 @@
; Maximum Transmission Rate
; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 }
; Set this value to the maximum desired transfer rate. Default: 14400
-maxrate=14400
+;maxrate=14400
; Minimum Transmission Rate
; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 }
; Set this value to the minimum desired transfer rate. Default: 4800
-minrate=4800
+;minrate=4800
; Send Progress/Status events to manager session
; Manager events with 'call' class permissions will receive events indicating the
@@ -21,8 +21,8 @@
; modem capabilities
; Possible values are { v17 | v27 | v29 }
; Set this value to modify the default modem options. Default: v17,v27,v29
-modems=v17,v27,v29
+;modems=v17,v27,v29
; Enable/disable T.30 ECM (error correction mode) by default.
; Default: Enabled
-ecm=yes
+;ecm=yes
Modified: team/moy/webrtc-11/configs/voicemail.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/configs/voicemail.conf.sample?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/configs/voicemail.conf.sample (original)
+++ team/moy/webrtc-11/configs/voicemail.conf.sample Sun Mar 2 19:02:31 2014
@@ -169,7 +169,8 @@
; Short 24h date format for pager use
;pagerdateformat=%T %D
;
-; You can override the default program to send e-mail if you wish, too
+; Using the mailcmd option, you can specify what command is called for
+; outbound E-mail. The default is shown below.
;
;mailcmd=/usr/sbin/sendmail -t
;
Modified: team/moy/webrtc-11/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/include/asterisk/rtp_engine.h?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/include/asterisk/rtp_engine.h (original)
+++ team/moy/webrtc-11/include/asterisk/rtp_engine.h Sun Mar 2 19:02:31 2014
@@ -539,7 +539,9 @@
enum ast_rtp_glue_result (*get_trtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance);
/*! Callback for updating the destination that the remote side should send RTP to */
int (*update_peer)(struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_rtp_instance *vinstance, struct ast_rtp_instance *tinstance, const struct ast_format_cap *cap, int nat_active);
- /*! Callback for retrieving codecs that the channel can do. Result returned in result_cap*/
+ /*! Callback for retrieving codecs that the channel can do. Result returned in result_cap.
+ * \note The channel chan will be locked during this call.
+ */
void (*get_codec)(struct ast_channel *chan, struct ast_format_cap *result_cap);
/*! Linked list information */
AST_RWLIST_ENTRY(ast_rtp_glue) entry;
Modified: team/moy/webrtc-11/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/main/rtp_engine.c?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/main/rtp_engine.c (original)
+++ team/moy/webrtc-11/main/rtp_engine.c Sun Mar 2 19:02:31 2014
@@ -1224,10 +1224,12 @@
if (tinstance1) {
ast_rtp_instance_get_remote_address(tinstance1, &tt1);
}
- if (glue1->get_codec) {
+ ast_channel_lock(c1);
+ if (glue1->get_codec && ast_channel_tech_pvt(c1)) {
ast_format_cap_remove_all(cap1);
glue1->get_codec(c1, cap1);
}
+ ast_channel_unlock(c1);
ast_rtp_instance_get_remote_address(instance0, &t0);
if (vinstance0) {
@@ -1236,10 +1238,12 @@
if (tinstance0) {
ast_rtp_instance_get_remote_address(tinstance0, &tt0);
}
- if (glue0->get_codec) {
+ ast_channel_lock(c0);
+ if (glue0->get_codec && ast_channel_tech_pvt(c0)) {
ast_format_cap_remove_all(cap0);
glue0->get_codec(c0, cap0);
}
+ ast_channel_unlock(c0);
if ((ast_sockaddr_cmp(&t1, &ac1)) ||
(vinstance1 && ast_sockaddr_cmp(&vt1, &vac1)) ||
@@ -1353,6 +1357,7 @@
ast_rtp_instance_get_remote_address(instance1, &t1);
ast_sockaddr_copy(&ac1, &t1);
/* Update codec information */
+ ast_channel_lock(c0);
if (glue0->get_codec && ast_channel_tech_pvt(c0)) {
ast_format_cap_remove_all(cap0);
ast_format_cap_remove_all(oldcap0);
@@ -1360,12 +1365,15 @@
ast_format_cap_append(oldcap0, cap0);
}
+ ast_channel_unlock(c0);
+ ast_channel_lock(c1);
if (glue1->get_codec && ast_channel_tech_pvt(c1)) {
ast_format_cap_remove_all(cap1);
ast_format_cap_remove_all(oldcap1);
glue1->get_codec(c1, cap1);
ast_format_cap_append(oldcap1, cap1);
}
+ ast_channel_unlock(c1);
/* Since UPDATE_BRIDGE_PEER is only used by the bridging code, don't forward it */
if (fr->subclass.integer != AST_CONTROL_UPDATE_RTP_PEER) {
ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
Modified: team/moy/webrtc-11/res/res_fax.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/res/res_fax.c?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/res/res_fax.c (original)
+++ team/moy/webrtc-11/res/res_fax.c Sun Mar 2 19:02:31 2014
@@ -3883,6 +3883,13 @@
goto end;
}
+ if (options.minrate == 2400 && (options.modems & AST_FAX_MODEM_V27) && !(options.modems & (AST_FAX_MODEM_V34))) {
+ ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
+ ast_log(LOG_WARNING, "'modems' setting '%s' is no longer accepted with 'minrate' setting %d\n", modems, options.minrate);
+ ast_log(LOG_WARNING, "'minrate' has been reset to 4800, please update res_fax.conf.\n");
+ options.minrate = 4800;
+ }
+
if (check_modem_rate(options.modems, options.minrate)) {
ast_fax_modem_to_str(options.modems, modems, sizeof(modems));
ast_log(LOG_ERROR, "'modems' setting '%s' is incompatible with 'minrate' setting %d\n", modems, options.minrate);
Modified: team/moy/webrtc-11/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/res/res_rtp_asterisk.c?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/res/res_rtp_asterisk.c (original)
+++ team/moy/webrtc-11/res/res_rtp_asterisk.c Sun Mar 2 19:02:31 2014
@@ -678,7 +678,7 @@
return;
}
- if (pj_ice_sess_add_cand(rtp->ice, comp_id, transport_id, type, local_pref, &foundation, addr, addr, rel_addr, addr_len, NULL) != PJ_SUCCESS) {
+ if (pj_ice_sess_add_cand(rtp->ice, comp_id, transport_id, type, local_pref, &foundation, addr, base_addr, rel_addr, addr_len, NULL) != PJ_SUCCESS) {
ao2_ref(candidate, -1);
return;
}
@@ -1683,15 +1683,19 @@
}
/* If configured to use a STUN server to get our external mapped address do so */
- if (stunaddr.sin_addr.s_addr && ast_sockaddr_is_ipv4(addr)) {
+ if (stunaddr.sin_addr.s_addr && ast_sockaddr_is_ipv4(addr) && count) {
struct sockaddr_in answer;
- if (!ast_stun_request(rtp->s, &stunaddr, NULL, &answer)) {
+ if (!ast_stun_request(component == AST_RTP_ICE_COMPONENT_RTCP ? rtp->rtcp->s : rtp->s, &stunaddr, NULL, &answer)) {
+ pj_sockaddr base;
pj_str_t mapped = pj_str(ast_strdupa(ast_inet_ntoa(answer.sin_addr)));
+ /* Use the first local host candidate as the base */
+ pj_sockaddr_cp(&base, &address[0]);
+
pj_sockaddr_init(pj_AF_INET(), &address[0], &mapped, ntohs(answer.sin_port));
- ast_rtp_ice_add_cand(rtp, component, transport, PJ_ICE_CAND_TYPE_SRFLX, 65535, &address[0], &address[0],
+ ast_rtp_ice_add_cand(rtp, component, transport, PJ_ICE_CAND_TYPE_SRFLX, 65535, &address[0], &base,
NULL, pj_sockaddr_get_len(&address[0]));
}
}
Modified: team/moy/webrtc-11/utils/astman.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/webrtc-11/utils/astman.c?view=diff&rev=409360&r1=409359&r2=409360
==============================================================================
--- team/moy/webrtc-11/utils/astman.c (original)
+++ team/moy/webrtc-11/utils/astman.c Sun Mar 2 19:02:31 2014
@@ -737,7 +737,6 @@
show_message("Login Failed", get_header(m, "Message"));
}
} else {
- memset(m, 0, sizeof(m));
manager_action("Login",
"Username: %s\r\n"
"Secret: %s\r\n",
More information about the asterisk-commits
mailing list