mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-29 15:36:13 +00:00
The rtptimeout setting is ignored on a per peer basis.
Not only is the rtptimeout ignored in some cases but rtpkeepalive and rtpholdtimeout is affected. this commit also removes rtptimeout/rtpholdtimeout on text rtp. (closes issue ASTERISK-18559) Review: https://reviewboard.asterisk.org/r/1452 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@338416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5047,9 +5047,9 @@ static int dialog_initialize_rtp(struct sip_pvt *dialog)
|
|||||||
if (!(dialog->vrtp = ast_rtp_instance_new(dialog->engine, sched, &bindaddr_tmp, NULL))) {
|
if (!(dialog->vrtp = ast_rtp_instance_new(dialog->engine, sched, &bindaddr_tmp, NULL))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ast_rtp_instance_set_timeout(dialog->vrtp, global_rtptimeout);
|
ast_rtp_instance_set_timeout(dialog->vrtp, dialog->rtptimeout);
|
||||||
ast_rtp_instance_set_hold_timeout(dialog->vrtp, global_rtpholdtimeout);
|
ast_rtp_instance_set_hold_timeout(dialog->vrtp, dialog->rtpholdtimeout);
|
||||||
ast_rtp_instance_set_keepalive(dialog->vrtp, global_rtpholdtimeout);
|
ast_rtp_instance_set_keepalive(dialog->vrtp, dialog->rtpkeepalive);
|
||||||
|
|
||||||
ast_rtp_instance_set_prop(dialog->vrtp, AST_RTP_PROPERTY_RTCP, 1);
|
ast_rtp_instance_set_prop(dialog->vrtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||||
}
|
}
|
||||||
@@ -5058,16 +5058,15 @@ static int dialog_initialize_rtp(struct sip_pvt *dialog)
|
|||||||
if (!(dialog->trtp = ast_rtp_instance_new(dialog->engine, sched, &bindaddr_tmp, NULL))) {
|
if (!(dialog->trtp = ast_rtp_instance_new(dialog->engine, sched, &bindaddr_tmp, NULL))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ast_rtp_instance_set_timeout(dialog->trtp, global_rtptimeout);
|
/* Do not timeout text as its not constant*/
|
||||||
ast_rtp_instance_set_hold_timeout(dialog->trtp, global_rtpholdtimeout);
|
ast_rtp_instance_set_keepalive(dialog->trtp, dialog->rtpkeepalive);
|
||||||
ast_rtp_instance_set_keepalive(dialog->trtp, global_rtpholdtimeout);
|
|
||||||
|
|
||||||
ast_rtp_instance_set_prop(dialog->trtp, AST_RTP_PROPERTY_RTCP, 1);
|
ast_rtp_instance_set_prop(dialog->trtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_rtp_instance_set_timeout(dialog->rtp, global_rtptimeout);
|
ast_rtp_instance_set_timeout(dialog->rtp, dialog->rtptimeout);
|
||||||
ast_rtp_instance_set_hold_timeout(dialog->rtp, global_rtpholdtimeout);
|
ast_rtp_instance_set_hold_timeout(dialog->rtp, dialog->rtpholdtimeout);
|
||||||
ast_rtp_instance_set_keepalive(dialog->rtp, global_rtpkeepalive);
|
ast_rtp_instance_set_keepalive(dialog->rtp, dialog->rtpkeepalive);
|
||||||
|
|
||||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_RTCP, 1);
|
||||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF, ast_test_flag(&dialog->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
|
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF, ast_test_flag(&dialog->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
|
||||||
@@ -5128,6 +5127,9 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
|
|||||||
|
|
||||||
ast_string_field_set(dialog, engine, peer->engine);
|
ast_string_field_set(dialog, engine, peer->engine);
|
||||||
|
|
||||||
|
dialog->rtptimeout = peer->rtptimeout;
|
||||||
|
dialog->rtpholdtimeout = peer->rtpholdtimeout;
|
||||||
|
dialog->rtpkeepalive = peer->rtpkeepalive;
|
||||||
if (dialog_initialize_rtp(dialog)) {
|
if (dialog_initialize_rtp(dialog)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -5135,23 +5137,10 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
|
|||||||
if (dialog->rtp) { /* Audio */
|
if (dialog->rtp) { /* Audio */
|
||||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF, ast_test_flag(&dialog->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
|
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF, ast_test_flag(&dialog->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
|
||||||
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF_COMPENSATE, ast_test_flag(&dialog->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
|
ast_rtp_instance_set_prop(dialog->rtp, AST_RTP_PROPERTY_DTMF_COMPENSATE, ast_test_flag(&dialog->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
|
||||||
ast_rtp_instance_set_timeout(dialog->rtp, peer->rtptimeout);
|
|
||||||
ast_rtp_instance_set_hold_timeout(dialog->rtp, peer->rtpholdtimeout);
|
|
||||||
ast_rtp_instance_set_keepalive(dialog->rtp, peer->rtpkeepalive);
|
|
||||||
/* Set Frame packetization */
|
/* Set Frame packetization */
|
||||||
ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(dialog->rtp), dialog->rtp, &dialog->prefs);
|
ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(dialog->rtp), dialog->rtp, &dialog->prefs);
|
||||||
dialog->autoframing = peer->autoframing;
|
dialog->autoframing = peer->autoframing;
|
||||||
}
|
}
|
||||||
if (dialog->vrtp) { /* Video */
|
|
||||||
ast_rtp_instance_set_timeout(dialog->vrtp, peer->rtptimeout);
|
|
||||||
ast_rtp_instance_set_hold_timeout(dialog->vrtp, peer->rtpholdtimeout);
|
|
||||||
ast_rtp_instance_set_keepalive(dialog->vrtp, peer->rtpkeepalive);
|
|
||||||
}
|
|
||||||
if (dialog->trtp) { /* Realtime text */
|
|
||||||
ast_rtp_instance_set_timeout(dialog->trtp, peer->rtptimeout);
|
|
||||||
ast_rtp_instance_set_hold_timeout(dialog->trtp, peer->rtpholdtimeout);
|
|
||||||
ast_rtp_instance_set_keepalive(dialog->trtp, peer->rtpkeepalive);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XXX TODO: get fields directly from peer only as they are needed using dialog->relatedpeer */
|
/* XXX TODO: get fields directly from peer only as they are needed using dialog->relatedpeer */
|
||||||
ast_string_field_set(dialog, peername, peer->name);
|
ast_string_field_set(dialog, peername, peer->name);
|
||||||
@@ -5178,7 +5167,6 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
|
|||||||
dialog->pickupgroup = peer->pickupgroup;
|
dialog->pickupgroup = peer->pickupgroup;
|
||||||
dialog->allowtransfer = peer->allowtransfer;
|
dialog->allowtransfer = peer->allowtransfer;
|
||||||
dialog->jointnoncodeccapability = dialog->noncodeccapability;
|
dialog->jointnoncodeccapability = dialog->noncodeccapability;
|
||||||
dialog->rtptimeout = peer->rtptimeout;
|
|
||||||
|
|
||||||
/* Update dialog authorization credentials */
|
/* Update dialog authorization credentials */
|
||||||
ao2_lock(peer);
|
ao2_lock(peer);
|
||||||
@@ -5291,11 +5279,14 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct ast_soc
|
|||||||
dialog->relatedpeer = ref_peer(peer, "create_addr: setting dialog's relatedpeer pointer");
|
dialog->relatedpeer = ref_peer(peer, "create_addr: setting dialog's relatedpeer pointer");
|
||||||
unref_peer(peer, "create_addr: unref peer from find_peer hashtab lookup");
|
unref_peer(peer, "create_addr: unref peer from find_peer hashtab lookup");
|
||||||
return res;
|
return res;
|
||||||
}
|
} else {
|
||||||
|
dialog->rtptimeout = global_rtptimeout;
|
||||||
|
dialog->rtpholdtimeout = global_rtpholdtimeout;
|
||||||
|
dialog->rtpkeepalive = global_rtpkeepalive;
|
||||||
if (dialog_initialize_rtp(dialog)) {
|
if (dialog_initialize_rtp(dialog)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ast_string_field_set(dialog, tohost, hostport.host);
|
ast_string_field_set(dialog, tohost, hostport.host);
|
||||||
dialog->allowed_methods &= ~sip_cfg.disallowed_methods;
|
dialog->allowed_methods &= ~sip_cfg.disallowed_methods;
|
||||||
@@ -15569,6 +15560,9 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
|
|||||||
else
|
else
|
||||||
p->noncodeccapability &= ~AST_RTP_DTMF;
|
p->noncodeccapability &= ~AST_RTP_DTMF;
|
||||||
p->jointnoncodeccapability = p->noncodeccapability;
|
p->jointnoncodeccapability = p->noncodeccapability;
|
||||||
|
p->rtptimeout = peer->rtptimeout;
|
||||||
|
p->rtpholdtimeout = peer->rtpholdtimeout;
|
||||||
|
p->rtpkeepalive = peer->rtpkeepalive;
|
||||||
if (!dialog_initialize_rtp(p)) {
|
if (!dialog_initialize_rtp(p)) {
|
||||||
if (p->rtp) {
|
if (p->rtp) {
|
||||||
ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &peer->prefs);
|
ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(p->rtp), p->rtp, &peer->prefs);
|
||||||
@@ -15690,6 +15684,9 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ
|
|||||||
/* Finally, apply the guest policy */
|
/* Finally, apply the guest policy */
|
||||||
if (sip_cfg.allowguest) {
|
if (sip_cfg.allowguest) {
|
||||||
get_rpid(p, req);
|
get_rpid(p, req);
|
||||||
|
p->rtptimeout = global_rtptimeout;
|
||||||
|
p->rtpholdtimeout = global_rtpholdtimeout;
|
||||||
|
p->rtpkeepalive = global_rtpkeepalive;
|
||||||
if (!dialog_initialize_rtp(p)) {
|
if (!dialog_initialize_rtp(p)) {
|
||||||
res = AUTH_SUCCESSFUL;
|
res = AUTH_SUCCESSFUL;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1038,6 +1038,8 @@ struct sip_pvt {
|
|||||||
time_t lastrtprx; /*!< Last RTP received */
|
time_t lastrtprx; /*!< Last RTP received */
|
||||||
time_t lastrtptx; /*!< Last RTP sent */
|
time_t lastrtptx; /*!< Last RTP sent */
|
||||||
int rtptimeout; /*!< RTP timeout time */
|
int rtptimeout; /*!< RTP timeout time */
|
||||||
|
int rtpholdtimeout; /*!< RTP timeout time on hold*/
|
||||||
|
int rtpkeepalive; /*!< RTP send packets for keepalive */
|
||||||
struct ast_ha *directmediaha; /*!< Which IPs are allowed to interchange direct media with this peer - copied from sip_peer */
|
struct ast_ha *directmediaha; /*!< Which IPs are allowed to interchange direct media with this peer - copied from sip_peer */
|
||||||
struct ast_sockaddr recv; /*!< Received as */
|
struct ast_sockaddr recv; /*!< Received as */
|
||||||
struct ast_sockaddr ourip; /*!< Our IP (as seen from the outside) */
|
struct ast_sockaddr ourip; /*!< Our IP (as seen from the outside) */
|
||||||
|
|||||||
Reference in New Issue
Block a user