aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-10 16:03:06 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-10 16:03:06 +0000
commitfeed89e379aa67e404316f76b036e0e2c49f1e11 (patch)
treeef936491dadbfdb3f29f8c5b48cfdde2a18357b5
parentac8e39fc4961e4919371646c02a80fc7c7e4c308 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@44804 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_misdn.c5
-rw-r--r--channels/chan_sip.c40
-rw-r--r--channels/misdn/isdn_lib.c1
3 files changed, 26 insertions, 20 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index b6280ce0b..2fddfe3d5 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -4463,7 +4463,10 @@ static int misdn_set_opt_exec(struct ast_channel *chan, void *data)
if (strlen(tok) > 1 && tok[1]=='1') {
chan_misdn_log(1, ch->bc->port, "SETOPT: HDLC \n");
- ch->bc->hdlc=1;
+ if (!ch->bc->hdlc) {
+ ch->bc->hdlc=1;
+ misdn_lib_setup_bc(ch->bc);
+ }
}
ch->bc->capability=INFO_CAPABILITY_DIGITAL_UNRESTRICTED;
break;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6b9d96d0f..b8fae44bc 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4828,8 +4828,8 @@ static void build_contact(struct sip_pvt *p)
static void build_rpid(struct sip_pvt *p)
{
int send_pres_tags = 1;
- const char *privacy=NULL;
- const char *screen=NULL;
+ const char *privacy = NULL;
+ const char *screen = NULL;
char buf[256];
const char *clid = default_callerid;
const char *clin = NULL;
@@ -4853,11 +4853,11 @@ static void build_rpid(struct sip_pvt *p)
break;
case AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN:
privacy = "off";
- screen = "pass";
+ screen = "yes";
break;
case AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN:
privacy = "off";
- screen = "fail";
+ screen = "no";
break;
case AST_PRES_ALLOWED_NETWORK_NUMBER:
privacy = "off";
@@ -4869,15 +4869,15 @@ static void build_rpid(struct sip_pvt *p)
break;
case AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN:
privacy = "full";
- screen = "pass";
+ screen = "yes";
break;
case AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN:
privacy = "full";
- screen = "fail";
+ screen = "no";
break;
case AST_PRES_PROHIB_NETWORK_NUMBER:
privacy = "full";
- screen = "pass";
+ screen = "yes";
break;
case AST_PRES_NUMBER_NOT_AVAILABLE:
send_pres_tags = 0;
@@ -6864,7 +6864,7 @@ static struct sip_pvt *get_sip_pvt_byid_locked(char *callid)
}
/*! \brief get_refer_info: Call transfer support (the REFER method) ---*/
-static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_req)
+static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_req, char **transfercontext)
{
char *p_refer_to = NULL, *p_referred_by = NULL, *h_refer_to = NULL, *h_referred_by = NULL, *h_contact = NULL;
@@ -6872,7 +6872,6 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
struct sip_request *req = NULL;
struct sip_pvt *sip_pvt_ptr = NULL;
struct ast_channel *chan = NULL, *peer = NULL;
- const char *transfercontext;
req = outgoing_req;
@@ -6949,12 +6948,12 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
*ptr = '\0';
}
- transfercontext = pbx_builtin_getvar_helper(sip_pvt->owner, "TRANSFER_CONTEXT");
- if (ast_strlen_zero(transfercontext))
- transfercontext = sip_pvt->context;
+ *transfercontext = pbx_builtin_getvar_helper(sip_pvt->owner, "TRANSFER_CONTEXT");
+ if (ast_strlen_zero(*transfercontext))
+ *transfercontext = sip_pvt->context;
if (sip_debug_test_pvt(sip_pvt)) {
- ast_verbose("Transfer to %s in %s\n", refer_to, transfercontext);
+ ast_verbose("Transfer to %s in %s\n", refer_to, *transfercontext);
if (referred_by)
ast_verbose("Transfer from %s in %s\n", referred_by, sip_pvt->context);
}
@@ -6979,7 +6978,7 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
INVITE with a replaces header -anthm XXX */
/* The only way to find out is to use the dialplan - oej */
}
- } else if (ast_exists_extension(NULL, transfercontext, refer_to, 1, NULL) || !strcmp(refer_to, ast_parking_ext())) {
+ } else if (ast_exists_extension(NULL, *transfercontext, refer_to, 1, NULL) || !strcmp(refer_to, ast_parking_ext())) {
/* This is an unsupervised transfer (blind transfer) */
ast_log(LOG_DEBUG,"Unsupervised transfer to (Refer-To): %s\n", refer_to);
@@ -6998,7 +6997,7 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_
pbx_builtin_setvar_helper(peer, "BLINDTRANSFER", chan->name);
}
return 0;
- } else if (ast_canmatch_extension(NULL, transfercontext, refer_to, 1, NULL)) {
+ } else if (ast_canmatch_extension(NULL, *transfercontext, refer_to, 1, NULL)) {
return 1;
}
@@ -7203,9 +7202,9 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
ast_copy_string(p->cid_name, calleridname, sizeof(p->cid_name));
rpid = get_header(req, "Remote-Party-ID");
- memset(rpid_num,0,sizeof(rpid_num));
+ memset(rpid_num, 0, sizeof(rpid_num));
if (!ast_strlen_zero(rpid))
- p->callingpres = get_rpid_num(rpid,rpid_num, sizeof(rpid_num));
+ p->callingpres = get_rpid_num(rpid, rpid_num, sizeof(rpid_num));
of = get_in_brackets(from);
if (ast_strlen_zero(p->exten)) {
@@ -10802,12 +10801,15 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
struct ast_channel *c=NULL;
int res;
struct ast_channel *transfer_to;
+ char *transfercontext = NULL;
if (option_debug > 2)
ast_log(LOG_DEBUG, "SIP call transfer received for call %s (REFER)!\n", p->callid);
+ res = get_refer_info(p, req, &transfercontext);
if (ast_strlen_zero(p->context))
strcpy(p->context, default_context);
- res = get_refer_info(p, req);
+ if (ast_strlen_zero(transfercontext))
+ transfercontext = p->context;
if (res < 0)
transmit_response(p, "603 Declined", req);
else if (res > 0)
@@ -10843,7 +10845,7 @@ static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int
be accessible after the transfer! */
*nounlock = 1;
ast_mutex_unlock(&c->lock);
- ast_async_goto(transfer_to,p->context, p->refer_to,1);
+ ast_async_goto(transfer_to, transfercontext, p->refer_to,1);
}
} else {
ast_log(LOG_DEBUG, "Got SIP blind transfer but nothing to transfer to.\n");
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index c0fdf31d8..ce25791a4 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -882,6 +882,7 @@ static int create_process (int midev, struct misdn_bchannel *bc) {
void misdn_lib_setup_bc(struct misdn_bchannel *bc)
{
+ clean_up_bc(bc);
setup_bc(bc);
}