diff options
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 155a3775e..99d8e36a3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1335,8 +1335,8 @@ struct sip_auth { /* re-INVITE related settings */ #define SIP_REINVITE (7 << 20) /*!< DP: four settings, uses three bits */ #define SIP_REINVITE_NONE (0 << 20) /*!< DP: no reinvite allowed */ -#define SIP_CAN_REINVITE (1 << 20) /*!< DP: allow peers to be reinvited to send media directly p2p */ -#define SIP_CAN_REINVITE_NAT (2 << 20) /*!< DP: allow media reinvite when new peer is behind NAT */ +#define SIP_DIRECT_MEDIA (1 << 20) /*!< DP: allow peers to be reinvited to send media directly p2p */ +#define SIP_DIRECT_MEDIA_NAT (2 << 20) /*!< DP: allow media reinvite when new peer is behind NAT */ #define SIP_REINVITE_UPDATE (4 << 20) /*!< DP: use UPDATE (RFC3311) when reinviting this peer */ /* "insecure" settings - see insecure2str() */ @@ -14796,7 +14796,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct ast_cli(fd, " Nat : %s\n", nat2str(ast_test_flag(&peer->flags[0], SIP_NAT))); ast_cli(fd, " ACL : %s\n", cli_yesno(peer->ha != NULL)); ast_cli(fd, " T38 pt UDPTL : %s\n", cli_yesno(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT))); - ast_cli(fd, " CanReinvite : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_CAN_REINVITE))); + ast_cli(fd, " DirectMedia : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA))); ast_cli(fd, " PromiscRedir : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_PROMISCREDIR))); ast_cli(fd, " User=Phone : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_USEREQPHONE))); ast_cli(fd, " Video Support: %s\n", cli_yesno(ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT))); @@ -14899,7 +14899,8 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct astman_append(s, "SIP-AuthInsecure: %s\r\n", insecure2str(ast_test_flag(&peer->flags[0], SIP_INSECURE))); astman_append(s, "SIP-NatSupport: %s\r\n", nat2str(ast_test_flag(&peer->flags[0], SIP_NAT))); astman_append(s, "ACL: %s\r\n", (peer->ha?"Y":"N")); - astman_append(s, "SIP-CanReinvite: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_CAN_REINVITE)?"Y":"N")); + astman_append(s, "SIP-CanReinvite: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA)?"Y":"N")); + astman_append(s, "SIP-DirectMedia: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA)?"Y":"N")); astman_append(s, "SIP-PromiscRedir: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_PROMISCREDIR)?"Y":"N")); astman_append(s, "SIP-UserPhone: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_USEREQPHONE)?"Y":"N")); astman_append(s, "SIP-VideoSupport: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT)?"Y":"N")); @@ -22535,11 +22536,11 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask ast_set_flag(&flags[0], SIP_NAT_ALWAYS); else ast_set_flag(&flags[0], SIP_NAT_RFC3581); - } else if (!strcasecmp(v->name, "canreinvite")) { + } else if (!strcasecmp(v->name, "directmedia") || !strcasecmp(v->name, "canreinvite")) { ast_set_flag(&mask[0], SIP_REINVITE); ast_clear_flag(&flags[0], SIP_REINVITE); if (ast_true(v->value)) { - ast_set_flag(&flags[0], SIP_CAN_REINVITE | SIP_CAN_REINVITE_NAT); + ast_set_flag(&flags[0], SIP_DIRECT_MEDIA | SIP_DIRECT_MEDIA_NAT); } else if (!ast_false(v->value)) { char buf[64]; char *word, *next = buf; @@ -22547,12 +22548,12 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask ast_copy_string(buf, v->value, sizeof(buf)); while ((word = strsep(&next, ","))) { if (!strcasecmp(word, "update")) { - ast_set_flag(&flags[0], SIP_REINVITE_UPDATE | SIP_CAN_REINVITE); + ast_set_flag(&flags[0], SIP_REINVITE_UPDATE | SIP_DIRECT_MEDIA); } else if (!strcasecmp(word, "nonat")) { - ast_set_flag(&flags[0], SIP_CAN_REINVITE); - ast_clear_flag(&flags[0], SIP_CAN_REINVITE_NAT); + ast_set_flag(&flags[0], SIP_DIRECT_MEDIA); + ast_clear_flag(&flags[0], SIP_DIRECT_MEDIA_NAT); } else { - ast_log(LOG_WARNING, "Unknown canreinvite mode '%s' on line %d\n", v->value, v->lineno); + ast_log(LOG_WARNING, "Unknown directmedia mode '%s' on line %d\n", v->value, v->lineno); } } } @@ -23625,7 +23626,7 @@ static int reload_config(enum channelreloadreason reason) ast_copy_string(default_vmexten, DEFAULT_VMEXTEN, sizeof(default_vmexten)); ast_set_flag(&global_flags[0], SIP_DTMF_RFC2833); /*!< Default DTMF setting: RFC2833 */ ast_set_flag(&global_flags[0], SIP_NAT_RFC3581); /*!< NAT support if requested by device with rport */ - ast_set_flag(&global_flags[0], SIP_CAN_REINVITE); /*!< Allow re-invites */ + ast_set_flag(&global_flags[0], SIP_DIRECT_MEDIA); /*!< Allow re-invites */ /* Debugging settings, always default to off */ dumphistory = FALSE; @@ -24331,7 +24332,7 @@ static struct ast_udptl *sip_get_udptl_peer(struct ast_channel *chan) return NULL; sip_pvt_lock(p); - if (p->udptl && ast_test_flag(&p->flags[0], SIP_CAN_REINVITE)) + if (p->udptl && ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) udptl = p->udptl; sip_pvt_unlock(p); return udptl; @@ -24381,9 +24382,9 @@ static enum ast_rtp_get_result sip_get_rtp_peer(struct ast_channel *chan, struct *rtp = p->rtp; - if (ast_rtp_getnat(*rtp) && !ast_test_flag(&p->flags[0], SIP_CAN_REINVITE_NAT)) + if (ast_rtp_getnat(*rtp) && !ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) res = AST_RTP_TRY_PARTIAL; - else if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE)) + else if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) res = AST_RTP_TRY_NATIVE; else if (ast_test_flag(&global_jbconf, AST_JB_FORCED)) res = AST_RTP_GET_FAILED; @@ -24410,7 +24411,7 @@ static enum ast_rtp_get_result sip_get_vrtp_peer(struct ast_channel *chan, struc *rtp = p->vrtp; - if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE)) + if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) res = AST_RTP_TRY_NATIVE; sip_pvt_unlock(p); @@ -24435,7 +24436,7 @@ static enum ast_rtp_get_result sip_get_trtp_peer(struct ast_channel *chan, struc *rtp = p->trtp; - if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE)) + if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) res = AST_RTP_TRY_NATIVE; sip_pvt_unlock(p); @@ -24467,10 +24468,10 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struc /* if this peer cannot handle reinvites of the media stream to devices that are known to be behind a NAT, then stop the process now */ - if (nat_active && !ast_test_flag(&p->flags[0], SIP_CAN_REINVITE_NAT)) { - sip_pvt_unlock(p); - return 0; - } + if (nat_active && !ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) { + sip_pvt_unlock(p); + return 0; + } if (rtp) { changed |= ast_rtp_get_peer(rtp, &p->redirip); |