More RSW merges. This should do it for the channels/ dir.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Sean Bright
2008-08-09 14:12:34 +00:00
parent 5275342c5e
commit db1ed285c4
8 changed files with 253 additions and 245 deletions

View File

@@ -153,10 +153,12 @@ static int nat = 0;
static ast_group_t cur_callergroup = 0;
static ast_group_t cur_pickupgroup = 0;
static unsigned int tos = 0;
static unsigned int tos_audio = 0;
static unsigned int cos = 0;
static unsigned int cos_audio = 0;
static struct {
unsigned int tos;
unsigned int tos_audio;
unsigned int cos;
unsigned int cos_audio;
} qos = { 0, 0, 0, 0 };
static int immediate = 0;
@@ -460,16 +462,16 @@ static int has_voicemail(struct mgcp_endpoint *p)
{
int new_msgs;
struct ast_event *event;
char *mailbox, *context;
char *mbox, *cntx;
context = mailbox = ast_strdupa(p->mailbox);
strsep(&context, "@");
if (ast_strlen_zero(context))
context = "default";
cntx = mbox = ast_strdupa(p->mailbox);
strsep(&cntx, "@");
if (ast_strlen_zero(cntx))
cntx = "default";
event = ast_event_get_cached(AST_EVENT_MWI,
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mbox,
AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, cntx,
AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
AST_EVENT_IE_END);
@@ -694,7 +696,7 @@ static int mgcp_postrequest(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
struct mgcp_message *msg;
struct mgcp_message *cur;
struct mgcp_gateway *gw;
struct timeval tv;
struct timeval now;
msg = ast_malloc(sizeof(*msg) + len);
if (!msg) {
@@ -731,8 +733,8 @@ static int mgcp_postrequest(struct mgcp_endpoint *p, struct mgcp_subchannel *sub
gw->msgs = msg;
}
tv = ast_tvnow();
msg->expire = tv.tv_sec * 1000 + tv.tv_usec / 1000 + DEFAULT_RETRANS;
now = ast_tvnow();
msg->expire = now.tv_sec * 1000 + now.tv_usec / 1000 + DEFAULT_RETRANS;
if (gw->retransid == -1)
gw->retransid = ast_sched_add(sched, DEFAULT_RETRANS, retrans_pkt, (void *)gw);
@@ -2644,7 +2646,7 @@ static void start_rtp(struct mgcp_subchannel *sub)
if (sub->rtp && sub->owner)
ast_channel_set_fd(sub->owner, 0, ast_rtp_fd(sub->rtp));
if (sub->rtp) {
ast_rtp_setqos(sub->rtp, tos_audio, cos_audio, "MGCP RTP");
ast_rtp_setqos(sub->rtp, qos.tos_audio, qos.cos_audio, "MGCP RTP");
ast_rtp_setnat(sub->rtp, sub->nat);
}
#if 0
@@ -3750,14 +3752,14 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox));
ast_copy_string(e->parkinglot, parkinglot, sizeof(e->parkinglot));
if (!ast_strlen_zero(e->mailbox)) {
char *mailbox, *context;
context = mailbox = ast_strdupa(e->mailbox);
strsep(&context, "@");
if (ast_strlen_zero(context))
context = "default";
char *mbox, *cntx;
cntx = mbox = ast_strdupa(e->mailbox);
strsep(&cntx, "@");
if (ast_strlen_zero(cntx))
cntx = "default";
e->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, NULL,
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mbox,
AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, cntx,
AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
AST_EVENT_IE_END);
}
@@ -4155,16 +4157,16 @@ static int reload_config(int reload)
else
capability &= ~format;
} else if (!strcasecmp(v->name, "tos")) {
if (ast_str2tos(v->value, &tos))
if (ast_str2tos(v->value, &qos.tos))
ast_log(LOG_WARNING, "Invalid tos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "tos_audio")) {
if (ast_str2tos(v->value, &tos_audio))
if (ast_str2tos(v->value, &qos.tos_audio))
ast_log(LOG_WARNING, "Invalid tos_audio value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos")) {
if (ast_str2cos(v->value, &cos))
if (ast_str2cos(v->value, &qos.cos))
ast_log(LOG_WARNING, "Invalid cos value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "cos_audio")) {
if (ast_str2cos(v->value, &cos_audio))
if (ast_str2cos(v->value, &qos.cos_audio))
ast_log(LOG_WARNING, "Invalid cos_audio value at line %d, refer to QoS documentation\n", v->lineno);
} else if (!strcasecmp(v->name, "port")) {
if (sscanf(v->value, "%d", &ourport) == 1) {
@@ -4249,7 +4251,7 @@ static int reload_config(int reload)
} else {
ast_verb(2, "MGCP Listening on %s:%d\n",
ast_inet_ntoa(bindaddr.sin_addr), ntohs(bindaddr.sin_port));
ast_netsock_set_qos(mgcpsock, tos, cos, "MGCP");
ast_netsock_set_qos(mgcpsock, qos.tos, qos.cos, "MGCP");
}
}
ast_mutex_unlock(&netlock);