return NULL;
}
- if (ast_string_field_init(tmp, 32)) {
- ao2_ref(tmp, -1);
- tmp = NULL;
- return NULL;
- }
-
- tmp->prefs = prefs;
tmp->pingid = -1;
tmp->lagid = -1;
tmp->autoid = -1;
tmp->authid = -1;
tmp->initid = -1;
tmp->keyrotateid = -1;
+ tmp->jbid = -1;
+
+ if (ast_string_field_init(tmp, 32)) {
+ ao2_ref(tmp, -1);
+ tmp = NULL;
+ return NULL;
+ }
+
+ tmp->prefs = prefs;
ast_string_field_set(tmp,exten, "s");
ast_string_field_set(tmp,host, host);
tmp->jb = jb_new();
- tmp->jbid = -1;
jbconf.max_jitterbuf = maxjitterbuffer;
jbconf.resync_threshold = resyncthreshold;
jbconf.max_contig_interp = maxjitterinterps;
ast_assert(esc != NULL);
ao2_unlink(esc->compositor, esc_entry);
+ esc_entry->sched_id = -1;
ao2_ref(esc_entry, -1);
return 0;
}
/* Bump refcount for scheduler */
ao2_ref(esc_entry, +1);
esc_entry->sched_id = ast_sched_add(sched, expires_ms, publish_expire, esc_entry);
+ if (esc_entry->sched_id == -1) {
+ ao2_ref(esc_entry, -1);
+ ao2_ref(esc_entry, -1);
+ return NULL;
+ }
/* Note: This links the esc_entry into the ESC properly */
create_new_sip_etag(esc_entry, 0);
AST_LIST_TRAVERSE(ast_channel_varshead(ast), current, entries) {
if (!(strcasecmp(ast_var_name(current),"SKINNY_AUTOANSWER"))) {
- if (d->hookstate == SKINNY_ONHOOK && !(sub->aa_sched < 0)) {
+ if (d->hookstate == SKINNY_ONHOOK && sub->aa_sched < 0) {
char buf[24];
int aatime;
char *stringp = buf, *curstr;
return;
}
- if (sub->dialer_sched) {
+ if (-1 < sub->dialer_sched) {
skinny_sched_del(sub->dialer_sched, sub);
sub->dialer_sched = -1;
}
- if (state != SUBSTATE_RINGIN && sub->aa_sched) {
+ if (state != SUBSTATE_RINGIN && -1 < sub->aa_sched) {
skinny_sched_del(sub->aa_sched, sub);
sub->aa_sched = -1;
sub->aa_beep = 0;
}
if ((sub->owner && ast_channel_state(sub->owner) < AST_STATE_UP)) {
- if (sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
+ if (-1 < sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Got a digit and not timed out, so try dialing\n", sub->callid);
sub->dialer_sched = -1;
len = strlen(sub->exten);
case SOFTKEY_BKSPC:
SKINNY_DEBUG(DEBUG_PACKET, 3, "Received SOFTKEY_BKSPC from %s, inst %d, callref %d\n",
d->name, instance, callreference);
- if (sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
+ if (-1 < sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) {
size_t len;
sub->dialer_sched = -1;
len = strlen(sub->exten);
AST_APP_ARG(port);
);
- if (!value) {
+ if (!reg) {
return -1;
}
- if (!reg) {
+ reg->expire = -1;
+ reg->timeout = -1;
+
+ if (!value) {
return -1;
}
+
ast_copy_string(buf, value, sizeof(buf));
/*! register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]
ast_string_field_set(reg, regdomain, ast_strip_quoted(S_OR(user2.domain, ""), "\"", "\""));
reg->transport = transport;
- reg->timeout = reg->expire = -1;
reg->portno = portnum;
reg->regdomainport = domainport;
reg->callid_valid = FALSE;
ast_channel_state_set(tmp, state);
ast_channel_streamid_set(tmp, -1);
+ ast_channel_vstreamid_set(tmp, -1);
ast_channel_fin_set(tmp, global_fin);
ast_channel_fout_set(tmp, global_fout);
pack = ast_calloc(1, len);
if (pack) {
pack->h = (struct dundi_hdr *)(pack->data);
+ pack->retransid = -1;
if (cmdresp != DUNDI_COMMAND_ACK) {
pack->retransid = ast_sched_add(sched, trans->retranstimer, dundi_rexmit, pack);
pack->retrans = DUNDI_DEFAULT_RETRANS - 1;