[Asterisk-cvs] asterisk/channels chan_h323.c,1.108,1.109
jeremy at lists.digium.com
jeremy at lists.digium.com
Thu Apr 28 23:33:09 CDT 2005
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv8041
Modified Files:
chan_h323.c
Log Message:
Fix codec negiocation on inbound calls. Bugs 3980, 4021, 4045
Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- chan_h323.c 21 Apr 2005 06:02:43 -0000 1.108
+++ chan_h323.c 29 Apr 2005 04:22:47 -0000 1.109
@@ -559,6 +559,7 @@
static int oh323_digit(struct ast_channel *c, char digit)
{
struct oh323_pvt *p = (struct oh323_pvt *) c->tech_pvt;
+ char *token;
if (h323debug)
ast_log(LOG_DEBUG, "Sending digit %c on %s\n", digit, c->name);
if (!p)
@@ -569,10 +570,15 @@
}
/* If in-band DTMF is desired, send that */
if ((p->dtmfmode & H323_DTMF_INBAND)) {
- h323_send_tone(p->cd.call_token, digit);
+ token = p->cd.call_token ? strdup(p->cd.call_token) : NULL;
+ ast_mutex_unlock(&p->lock);
+ h323_send_tone(token, digit);
+ if (token)
+ free(token);
+ oh323_update_info(c);
}
- ast_mutex_unlock(&p->lock);
- oh323_update_info(c);
+ else
+ ast_mutex_unlock(&p->lock);
return 0;
}
@@ -1014,6 +1020,7 @@
pvt->cd.call_reference = callid;
pvt->bridge = bridging;
pvt->dtmfmode = dtmfmode;
+ pvt->capability = capability;
if (pvt->dtmfmode & H323_DTMF_RFC2833) {
pvt->nonCodecCapability |= AST_RTP_DTMF;
}
@@ -1194,10 +1201,6 @@
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%d'\n", format);
return NULL;
}
- /* Assign default capabilities */
- pvt->capability = capability;
- pvt->dtmfmode = H323_DTMF_RFC2833;
-
strncpy(tmp, dest, sizeof(tmp) - 1);
host = strchr(tmp, '@');
if (host) {
@@ -1222,6 +1225,8 @@
return NULL;
}
}
+ else
+ memcpy(&pvt->options, &global_options, sizeof(pvt->options));
/* pass on our capabilites to the H.323 stack */
ast_mutex_lock(&caplock);
@@ -1291,7 +1296,7 @@
struct oh323_pvt *pvt;
struct sockaddr_in us;
struct rtp_info *info;
- static char iabuf[INET_ADDRSTRLEN];
+ char iabuf[INET_ADDRSTRLEN];
info = (struct rtp_info *)malloc(sizeof(struct rtp_info));
if (!info) {
@@ -2405,6 +2410,12 @@
}
h323_gk_urq();
h323_end_process();
+ io_context_destroy(io);
+ sched_context_destroy(sched);
+ delete_users();
+ delete_aliases();
+ prune_peers();
+ ast_mutex_destroy(&aliasl.lock);
ast_mutex_destroy(&userl.lock);
ast_mutex_destroy(&peerl.lock);
return 0;
More information about the svn-commits
mailing list