diff options
author | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-02-24 06:00:18 +0000 |
---|---|---|
committer | matteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-02-24 06:00:18 +0000 |
commit | f6a861f645e0b978daabe5c2095a22cb69978d5c (patch) | |
tree | 388e986b909e145722de5c909a1496e0402a4ac7 /channels | |
parent | b6be24372a79c5fe8568a831bab188db9ea98e8c (diff) |
Mon Feb 24 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@622 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 15 | ||||
-rwxr-xr-x | channels/chan_zap.c | 30 |
2 files changed, 36 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index fa0c1fa81..b71459b6d 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1163,8 +1163,12 @@ static int sip_register(char *value, int lineno) return -1; strncpy(copy, value, sizeof(copy)-1); stringp=copy; - username = strsep(&stringp, "@"); - hostname = strsep(&stringp, "@"); + username = stringp; + hostname = strrchr(stringp, '@'); + if (hostname) { + *hostname = '\0'; + hostname++; + } if (!hostname) { ast_log(LOG_WARNING, "Format for registration is user[:secret]@host[:port] at line %d", lineno); return -1; @@ -2325,10 +2329,10 @@ static int get_refer_info(struct sip_pvt *p, struct sip_request *oreq) *a2 = '\0'; - if (sipdebug) + if (sipdebug) { ast_verbose("Looking for %s in %s\n", c, p->context); ast_verbose("Looking for %s in %s\n", c2, p->context); - + } if (strlen(tmp5)) { /* This is a supervised transfer */ ast_log(LOG_DEBUG,"Assigning Replace-Call-ID Info %s to REPLACE_CALL_ID\n",tmp5); @@ -2355,7 +2359,7 @@ static int get_refer_info(struct sip_pvt *p, struct sip_request *oreq) return 0; else ast_log(LOG_NOTICE, "Supervised transfer requested, but unable to find callid '%s'\n", tmp5); - } else if (ast_exists_extension(NULL, p->context, c, 1, NULL) && ast_exists_extension(NULL, p->context, c2, 1, NULL)) { + } else if (ast_exists_extension(NULL, p->context, c, 1, NULL)) { /* This is an unsupervised transfer */ ast_log(LOG_DEBUG,"Assigning Extension %s to REFER-TO\n", c); ast_log(LOG_DEBUG,"Assigning Extension %s to REFERRED-BY\n", c2); @@ -3294,6 +3298,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc ast_async_goto(transfer_to,"", p->refer_to,1, 1); } } + transmit_request(p, "BYE", p->outgoing); } } else if (!strcasecmp(cmd, "CANCEL") || !strcasecmp(cmd, "BYE")) { copy_request(&p->initreq, req); diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 59e036d7c..23cc2fb5b 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -1,11 +1,11 @@ /* * Asterisk -- A telephony toolkit for Linux. * - * Tormenta T1 Card (via Zapata library) support + * Zaptel Pseudo TDM interface * - * Copyright (C) 1999, Mark Spencer + * Copyright (C) 2003 Digium * - * Mark Spencer <markster@linux-support.net> + * Mark Spencer <markster@digium.com> * * This program is free software, distributed under the terms of * the GNU General Public License @@ -2275,6 +2275,28 @@ static mfcr2_event_t *r2_get_event_bits(struct zt_pvt *p) } #endif +static int check_for_conference(struct zt_pvt *p) +{ + ZT_CONFINFO ci; + /* Fine if we already have a master, etc */ + if (p->master || (p->confno > -1)) + return 0; + memset(&ci, 0, sizeof(ci)); + if (ioctl(p->subs[SUB_REAL].zfd, ZT_GETCONF, &ci)) { + ast_log(LOG_WARNING, "Failed to get conference info on channel %d\n", p->channel); + return 0; + } + /* If we have no master and don't have a confno, then + if we're in a conference, it's probably a MeetMe room or + some such, so don't let us 3-way out! */ + if (ci.confno) { + if (option_verbose > 2) + ast_verbose(VERBOSE_PREFIX_3 "Avoiding 3-way call when in an external conference\n"); + return 1; + } + return 0; +} + static struct ast_frame *zt_handle_event(struct ast_channel *ast) { int res,x; @@ -2550,7 +2572,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast) if (p->subs[SUB_REAL].owner->bridge) ast_moh_stop(p->subs[SUB_REAL].owner->bridge); } else if (!p->subs[SUB_THREEWAY].owner) { - if (p->threewaycalling) { + if (p->threewaycalling && !check_for_conference(p)) { /* XXX This section needs much more error checking!!! XXX */ /* Start a 3-way call if feasible */ if ((ast->pbx) || |