mirror of
https://github.com/asterisk/asterisk.git
synced 2025-12-12 18:12:33 +00:00
Add option for in-band progress (bug #1879)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -158,6 +158,8 @@ static int globalrtpholdtimeout = 0;
|
||||
|
||||
static int globaltrustrpid = 0;
|
||||
|
||||
static int globalprogressinband = 0;
|
||||
|
||||
#ifdef OSP_SUPPORT
|
||||
static int globalospauth = 0;
|
||||
#endif
|
||||
@@ -341,6 +343,7 @@ static struct sip_pvt {
|
||||
int promiscredir; /* Promiscuous redirection */
|
||||
|
||||
int trustrpid;
|
||||
int progressinband;
|
||||
|
||||
int dtmfmode;
|
||||
struct ast_dsp *vad;
|
||||
@@ -400,6 +403,7 @@ struct sip_user {
|
||||
int promiscredir;
|
||||
int restrictcid;
|
||||
int trustrpid;
|
||||
int progressinband;
|
||||
struct ast_ha *ha;
|
||||
#ifdef MYSQL_USERS
|
||||
int temponly;
|
||||
@@ -440,6 +444,7 @@ struct sip_peer {
|
||||
int promiscredir;
|
||||
int dtmfmode;
|
||||
int trustrpid;
|
||||
int progressinband;
|
||||
struct sockaddr_in addr;
|
||||
struct in_addr mask;
|
||||
|
||||
@@ -1872,6 +1877,7 @@ static int sip_indicate(struct ast_channel *ast, int condition)
|
||||
if (!p->progress) {
|
||||
transmit_response(p, "180 Ringing", &p->initreq);
|
||||
p->ringing = 1;
|
||||
if (!p->progressinband)
|
||||
break;
|
||||
} else {
|
||||
/* Oops, we've sent progress tones. Let Asterisk do it instead */
|
||||
@@ -2251,6 +2257,7 @@ static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin, int useg
|
||||
p->dtmfmode = globaldtmfmode;
|
||||
p->promiscredir = globalpromiscredir;
|
||||
p->trustrpid = globaltrustrpid;
|
||||
p->progressinband = globalprogressinband;
|
||||
#ifdef OSP_SUPPORT
|
||||
p->ospauth = globalospauth;
|
||||
#endif
|
||||
@@ -5051,6 +5058,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd
|
||||
p->ospauth = user->ospauth;
|
||||
#endif
|
||||
p->trustrpid = user->trustrpid;
|
||||
p->progressinband = user->progressinband;
|
||||
/* replace callerid if rpid found, and not restricted */
|
||||
if(!ast_strlen_zero(rpid_num) && p->trustrpid) {
|
||||
if (*calleridname)
|
||||
@@ -5121,6 +5129,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, char *cmd
|
||||
/* Take the peer */
|
||||
p->nat = peer->nat;
|
||||
p->trustrpid = peer->trustrpid;
|
||||
p->progressinband = peer->progressinband;
|
||||
/* replace callerid if rpid found, and not restricted */
|
||||
if(!ast_strlen_zero(rpid_num) && p->trustrpid) {
|
||||
if (*calleridname)
|
||||
@@ -7564,6 +7573,7 @@ static struct sip_user *build_user(char *name, struct ast_variable *v)
|
||||
|
||||
user->canreinvite = globalcanreinvite;
|
||||
user->trustrpid = globaltrustrpid;
|
||||
user->progressinband = globalprogressinband;
|
||||
#ifdef OSP_SUPPORT
|
||||
user->ospauth = globalospauth;
|
||||
#endif
|
||||
@@ -7647,6 +7657,8 @@ static struct sip_user *build_user(char *name, struct ast_variable *v)
|
||||
user->restrictcid = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "trustrpid")) {
|
||||
user->trustrpid = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "progressinband")) {
|
||||
user->progressinband = ast_true(v->value);
|
||||
#ifdef OSP_SUPPORT
|
||||
} else if (!strcasecmp(v->name, "ospauth")) {
|
||||
if (!strcasecmp(v->value, "exclusive")) {
|
||||
@@ -7694,6 +7706,7 @@ static struct sip_peer *temp_peer(char *name)
|
||||
peer->selfdestruct = 1;
|
||||
peer->dynamic = 1;
|
||||
peer->trustrpid = globaltrustrpid;
|
||||
peer->progressinband = globalprogressinband;
|
||||
#ifdef OSP_SUPPORT
|
||||
peer->ospauth = globalospauth;
|
||||
#endif
|
||||
@@ -7758,6 +7771,7 @@ static struct sip_peer *build_peer(char *name, struct ast_variable *v)
|
||||
peer->dtmfmode = 0;
|
||||
peer->promiscredir = globalpromiscredir;
|
||||
peer->trustrpid = globaltrustrpid;
|
||||
peer->progressinband = globalprogressinband;
|
||||
#ifdef OSP_SUPPORT
|
||||
peer->ospauth = globalospauth;
|
||||
#endif
|
||||
@@ -7888,6 +7902,8 @@ static struct sip_peer *build_peer(char *name, struct ast_variable *v)
|
||||
}
|
||||
} else if (!strcasecmp(v->name, "trustrpid")) {
|
||||
peer->trustrpid = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "progressinband")) {
|
||||
peer->progressinband = ast_true(v->value);
|
||||
#ifdef OSP_SUPPORT
|
||||
} else if (!strcasecmp(v->name, "ospauth")) {
|
||||
if (!strcasecmp(v->value, "exclusive")) {
|
||||
@@ -8015,6 +8031,8 @@ static int reload_config(void)
|
||||
srvlookup = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "trustrpid")) {
|
||||
globaltrustrpid = ast_true(v->value);
|
||||
} else if (!strcasecmp(v->name, "progressinband")) {
|
||||
globalprogressinband = ast_true(v->value);
|
||||
#ifdef OSP_SUPPORT
|
||||
} else if (!strcasecmp(v->name, "ospauth")) {
|
||||
if (!strcasecmp(v->value, "exclusive")) {
|
||||
|
||||
@@ -58,6 +58,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP activity
|
||||
; when we're on hold (must be > rtptimeout)
|
||||
;trustrpid = no ; If Remote-Party-ID should be trusted
|
||||
;progressinband=no ; If we should generate in-band ringing always
|
||||
;useragent=Asterisk PBX ; Allows you to change the user agent string
|
||||
;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address
|
||||
; Asterisk can register as a SIP user agent to a SIP proxy (provider)
|
||||
@@ -123,6 +124,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
|
||||
; disallow disallow
|
||||
; insecure insecure
|
||||
; trustrpid trustrpid
|
||||
; progressinband progressinband
|
||||
; promiscredir promiscredir
|
||||
; callerid
|
||||
; accountcode
|
||||
|
||||
Reference in New Issue
Block a user