summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-05-09 21:22:42 +0000
committerMark Michelson <mmichelson@digium.com>2008-05-09 21:22:42 +0000
commit7daebcd61030cd5efdc68a630c31a71ba2e79442 (patch)
treee6fd3676de72e72333e4784a6fb64c38f41c6fb4 /channels/chan_skinny.c
parent59817ce0d84174c84cf49bee28557e2a0d5f45c2 (diff)
Adding support for "urgent" voicemail messages. Messages which are
marked "urgent" are considered to be higher priority than other messages and so they will be played before any other messages in a user's mailbox. There are two ways to leave an urgent message. 1. send the 'U' option to VoiceMail(). 2. Set review=yes in voicemail.conf. This will give instructions for a caller to mark a message as urgent after the message has been recorded. I have tested that this works correctly with file and ODBC storage, and James Rothenberger (who wrote initial support for this feature) has tested its use with IMAP storage. (closes issue #11817) Reported by: jaroth Based on branch http://svn.digium.com/svn/asterisk/team/jrothenberger/asterisk-urgent Tested by: putnopvut, jaroth git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c342
1 files changed, 115 insertions, 227 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 39aed4fc6..13d60c0a2 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -67,7 +67,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/abstract_jb.h"
#include "asterisk/threadstorage.h"
#include "asterisk/devicestate.h"
-#include "asterisk/event.h"
/*************************************
* Skinny/Asterisk Protocol Settings *
@@ -969,7 +968,6 @@ static char mohsuggest[MAX_MUSICCLASS] = "";
static char cid_num[AST_MAX_EXTENSION] = "";
static char cid_name[AST_MAX_EXTENSION] = "";
static char linelabel[AST_MAX_EXTENSION] ="";
-static char parkinglot[AST_MAX_CONTEXT] ="";
static int nat = 0;
static ast_group_t cur_callergroup = 0;
static ast_group_t cur_pickupgroup = 0;
@@ -1003,20 +1001,11 @@ static int canreinvite = 0;
#define SKINNY_DEVICE_ATA186 12 /* Cisco ATA-186 */
#define SKINNY_DEVICE_7941 115
#define SKINNY_DEVICE_7971 119
-#define SKINNY_DEVICE_7914 124 /* Expansion module */
#define SKINNY_DEVICE_7985 302
#define SKINNY_DEVICE_7911 307
#define SKINNY_DEVICE_7961GE 308
#define SKINNY_DEVICE_7941GE 309
-#define SKINNY_DEVICE_7931 348
#define SKINNY_DEVICE_7921 365
-#define SKINNY_DEVICE_7906 369
-#define SKINNY_DEVICE_7962 404 /* Not found */
-#define SKINNY_DEVICE_7937 431
-#define SKINNY_DEVICE_7942 434
-#define SKINNY_DEVICE_7945 435
-#define SKINNY_DEVICE_7965 436
-#define SKINNY_DEVICE_7975 437
#define SKINNY_DEVICE_7905 20000
#define SKINNY_DEVICE_7920 30002
#define SKINNY_DEVICE_7970 30006
@@ -1164,14 +1153,12 @@ struct skinny_line {
char vmexten[AST_MAX_EXTENSION];
char regexten[AST_MAX_EXTENSION]; /* Extension for auto-extensions */
char regcontext[AST_MAX_CONTEXT]; /* Context for auto-extensions */
- char parkinglot[AST_MAX_CONTEXT]; /* Parkinglot for parkedcalls */
char mohinterpret[MAX_MUSICCLASS];
char mohsuggest[MAX_MUSICCLASS];
char lastnumberdialed[AST_MAX_EXTENSION]; /* Last number that was dialed - used for redial */
int curtone; /* Current tone being played */
ast_group_t callgroup;
ast_group_t pickupgroup;
- struct ast_event_sub *mwi_event_sub; /* Event based MWI */
int callwaiting;
int transfer;
int threewaycalling;
@@ -1236,7 +1223,6 @@ static struct skinny_device {
int lastlineinstance;
int lastcallreference;
int capability;
- int earlyrtp;
struct sockaddr_in addr;
struct in_addr ourip;
struct skinny_line *lines;
@@ -1353,16 +1339,12 @@ static void *get_button_template(struct skinnysession *s, struct button_definiti
case SKINNY_DEVICE_7960:
case SKINNY_DEVICE_7961:
case SKINNY_DEVICE_7961GE:
- case SKINNY_DEVICE_7962:
- case SKINNY_DEVICE_7965:
for (i = 0; i < 6; i++)
(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
break;
case SKINNY_DEVICE_7940:
case SKINNY_DEVICE_7941:
case SKINNY_DEVICE_7941GE:
- case SKINNY_DEVICE_7942:
- case SKINNY_DEVICE_7945:
for (i = 0; i < 2; i++)
(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
break;
@@ -1376,7 +1358,6 @@ static void *get_button_template(struct skinnysession *s, struct button_definiti
break;
case SKINNY_DEVICE_7970:
case SKINNY_DEVICE_7971:
- case SKINNY_DEVICE_7975:
case SKINNY_DEVICE_CIPC:
for (i = 0; i < 8; i++)
(btn++)->buttonDefinition = BT_CUST_LINESPEEDDIAL;
@@ -1403,18 +1384,6 @@ static void *get_button_template(struct skinnysession *s, struct button_definiti
case SKINNY_DEVICE_7902:
ast_log(LOG_WARNING, "Unsupported device type '%d (7902)' found.\n", d->type);
break;
- case SKINNY_DEVICE_7906:
- ast_log(LOG_WARNING, "Unsupported device type '%d (7906)' found.\n", d->type);
- break;
- case SKINNY_DEVICE_7931:
- ast_log(LOG_WARNING, "Unsupported device type '%d (7931)' found.\n", d->type);
- break;
- case SKINNY_DEVICE_7937:
- ast_log(LOG_WARNING, "Unsupported device type '%d (7937)' found.\n", d->type);
- break;
- case SKINNY_DEVICE_7914:
- ast_log(LOG_WARNING, "Unsupported device type '%d (7914)' found. Expansion module registered by itself?\n", d->type);
- break;
case SKINNY_DEVICE_SCCPGATEWAY_AN:
case SKINNY_DEVICE_SCCPGATEWAY_BRI:
ast_log(LOG_WARNING, "Unsupported device type '%d (SCCP gateway)' found.\n", d->type);
@@ -1828,7 +1797,7 @@ static int transmit_response(struct skinnysession *s, struct skinny_req *req)
int res = 0;
if (!s) {
- ast_log(LOG_WARNING, "Asked to transmit to a non-existent session!\n");
+ ast_log(LOG_WARNING, "Asked to transmit to a non-existant session!\n");
return -1;
}
@@ -1893,7 +1862,7 @@ static void transmit_callinfo(struct skinnysession *s, const char *fromname, con
return;
if (skinnydebug)
- ast_verb(1, "Setting Callinfo to %s(%s) from %s(%s) on %s(%d)\n", fromname, fromnum, toname, tonum, s->device->name, instance);
+ ast_debug(1, "Setting Callinfo to %s(%s) from %s(%s) on %s(%d)\n", fromname, fromnum, toname, tonum, s->device->name, instance);
if (fromname) {
ast_copy_string(req->data.callinfo.callingPartyName, fromname, sizeof(req->data.callinfo.callingPartyName));
@@ -1993,7 +1962,7 @@ static void transmit_ringer_mode(struct skinnysession *s, int mode)
struct skinny_req *req;
if (skinnydebug)
- ast_verb(1, "Setting ringer mode to '%d'.\n", mode);
+ ast_debug(1, "Setting ringer mode to '%d'.\n", mode);
if (!(req = req_alloc(sizeof(struct set_ringer_message), SET_RINGER_MESSAGE)))
return;
@@ -2025,14 +1994,14 @@ static void transmit_displaymessage(struct skinnysession *s, const char *text, i
req->data.clearpromptstatus.callReference = reference;
if (skinnydebug)
- ast_verb(1, "Clearing Display\n");
+ ast_debug(1, "Clearing Display\n");
} else {
if (!(req = req_alloc(sizeof(struct displaytext_message), DISPLAYTEXT_MESSAGE)))
return;
ast_copy_string(req->data.displaytext.text, text, sizeof(req->data.displaytext.text));
if (skinnydebug)
- ast_verb(1, "Displaying message '%s'\n", req->data.displaytext.text);
+ ast_debug(1, "Displaying message '%s'\n", req->data.displaytext.text);
}
transmit_response(s, req);
@@ -2049,7 +2018,7 @@ static void transmit_displaynotify(struct skinnysession *s, const char *text, in
req->data.displaynotify.displayTimeout = htolel(t);
if (skinnydebug)
- ast_verb(1, "Displaying notify '%s'\n", text);
+ ast_debug(1, "Displaying notify '%s'\n", text);
transmit_response(s, req);
}
@@ -2066,7 +2035,7 @@ static void transmit_displaypromptstatus(struct skinnysession *s, const char *te
req->data.clearpromptstatus.callReference = htolel(callid);
if (skinnydebug)
- ast_verb(1, "Clearing Prompt\n");
+ ast_debug(1, "Clearing Prompt\n");
} else {
if (!(req = req_alloc(sizeof(struct display_prompt_status_message), DISPLAY_PROMPT_STATUS_MESSAGE)))
return;
@@ -2077,7 +2046,7 @@ static void transmit_displaypromptstatus(struct skinnysession *s, const char *te
req->data.displaypromptstatus.callReference = htolel(callid);
if (skinnydebug)
- ast_verb(1, "Displaying Prompt Status '%s'\n", text);
+ ast_debug(1, "Displaying Prompt Status '%s'\n", text);
}
transmit_response(s, req);
@@ -2240,42 +2209,16 @@ static int skinny_extensionstate_cb(char *context, char *exten, int state, void
return 0;
}
-static void mwi_event_cb(const struct ast_event *event, void *userdata)
-{
- /* This module does not handle MWI in an event-based manner. However, it
- * subscribes to MWI for each mailbox that is configured so that the core
- * knows that we care about it. Then, chan_skinny will get the MWI from the
- * event cache instead of checking the mailbox directly. */
-}
-
static int has_voicemail(struct skinny_line *l)
{
- int new_msgs;
- struct ast_event *event;
- char *mailbox, *context;
-
- context = mailbox = ast_strdupa(l->mailbox);
- strsep(&context, "@");
- if (ast_strlen_zero(context))
- context = "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_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
- AST_EVENT_IE_END);
-
- if (event) {
- new_msgs = ast_event_get_ie_uint(event, AST_EVENT_IE_NEWMSGS);
- ast_event_destroy(event);
- } else
- new_msgs = ast_app_has_voicemail(l->mailbox, NULL);
-
- return new_msgs;
+ return ast_app_has_voicemail(l->mailbox, NULL);
}
static void do_housekeeping(struct skinnysession *s)
{
+ int new;
+ int old;
+ int urgent;
int device_lamp = 0;
struct skinny_device *d = s->device;
struct skinny_line *l;
@@ -2288,8 +2231,9 @@ static void do_housekeeping(struct skinnysession *s)
if (has_voicemail(l)) {
if (skinnydebug)
ast_verb(1, "Checking for voicemail Skinny %s@%s\n", l->name, d->name);
+ ast_app_inboxcount(l->mailbox, &urgent, &new, &old);
if (skinnydebug)
- ast_verb(1, "Skinny %s@%s has voicemail!\n", l->name, d->name);
+ ast_debug(1, "Skinny %s@%s has voicemail!\n", l->name, d->name);
transmit_lamp_indication(s, STIMULUS_VOICEMAIL, l->instance, l->mwiblink?SKINNY_LAMP_BLINK:SKINNY_LAMP_ON);
device_lamp++;
} else {
@@ -2325,7 +2269,7 @@ static enum ast_rtp_get_result skinny_get_rtp_peer(struct ast_channel *c, struct
enum ast_rtp_get_result res = AST_RTP_TRY_NATIVE;
if (skinnydebug)
- ast_verb(1, "skinny_get_rtp_peer() Channel = %s\n", c->name);
+ ast_debug(1, "skinny_get_rtp_peer() Channel = %s\n", c->name);
if (!(sub = c->tech_pvt))
@@ -2345,7 +2289,7 @@ static enum ast_rtp_get_result skinny_get_rtp_peer(struct ast_channel *c, struct
if (!l->canreinvite || l->nat){
res = AST_RTP_TRY_PARTIAL;
if (skinnydebug)
- ast_verb(1, "skinny_get_rtp_peer() Using AST_RTP_TRY_PARTIAL \n");
+ ast_debug(1, "skinny_get_rtp_peer() Using AST_RTP_TRY_PARTIAL \n");
}
ast_mutex_unlock(&sub->lock);
@@ -2390,7 +2334,7 @@ static int skinny_set_rtp_peer(struct ast_channel *c, struct ast_rtp *rtp, struc
transmit_response(s, req);
if (skinnydebug)
- ast_verb(1, "Peerip = %s:%d\n", ast_inet_ntoa(them.sin_addr), ntohs(them.sin_port));
+ ast_debug(1, "Peerip = %s:%d\n", ast_inet_ntoa(them.sin_addr), ntohs(them.sin_port));
if (!(req = req_alloc(sizeof(struct start_media_transmission_message), START_MEDIA_TRANSMISSION_MESSAGE)))
return -1;
@@ -2398,7 +2342,7 @@ static int skinny_set_rtp_peer(struct ast_channel *c, struct ast_rtp *rtp, struc
fmt = ast_codec_pref_getsize(&l->prefs, ast_best_codec(l->capability));
if (skinnydebug)
- ast_verb(1, "Setting payloadType to '%d' (%d ms)\n", fmt.bits, fmt.cur_ms);
+ ast_debug(1, "Setting payloadType to '%d' (%d ms)\n", fmt.bits, fmt.cur_ms);
req->data.startmedia.conferenceId = htolel(sub->callid);
req->data.startmedia.passThruPartyId = htolel(sub->callid);
@@ -2610,8 +2554,6 @@ static char *device2str(int type)
return "7941";
case SKINNY_DEVICE_7971:
return "7971";
- case SKINNY_DEVICE_7914:
- return "7914";
case SKINNY_DEVICE_7985:
return "7985";
case SKINNY_DEVICE_7911:
@@ -2620,24 +2562,8 @@ static char *device2str(int type)
return "7961GE";
case SKINNY_DEVICE_7941GE:
return "7941GE";
- case SKINNY_DEVICE_7931:
- return "7931";
case SKINNY_DEVICE_7921:
return "7921";
- case SKINNY_DEVICE_7906:
- return "7906";
- case SKINNY_DEVICE_7962:
- return "7962";
- case SKINNY_DEVICE_7937:
- return "7937";
- case SKINNY_DEVICE_7942:
- return "7942";
- case SKINNY_DEVICE_7945:
- return "7945";
- case SKINNY_DEVICE_7965:
- return "7965";
- case SKINNY_DEVICE_7975:
- return "7975";
case SKINNY_DEVICE_7905:
return "7905";
case SKINNY_DEVICE_7920:
@@ -2977,7 +2903,6 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
else
memset(device_vmexten, 0, sizeof(device_vmexten));
- d->earlyrtp = 1;
while(v) {
if (!strcasecmp(v->name, "host")) {
if (ast_get_ip(&d->addr, v->value)) {
@@ -3004,8 +2929,6 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
ast_copy_string(d->version_id, v->value, sizeof(d->version_id));
} else if (!strcasecmp(v->name, "canreinvite")) {
canreinvite = ast_true(v->value);
- } else if (!strcasecmp(v->name, "earlyrtp")) {
- d->earlyrtp = ast_true(v->value);
} else if (!strcasecmp(v->name, "nat")) {
nat = ast_true(v->value);
} else if (!strcasecmp(v->name, "callerid")) {
@@ -3054,8 +2977,6 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
ast_copy_string(linelabel, v->value, sizeof(linelabel));
} else if (!strcasecmp(v->name, "setvar")) {
chanvars = add_var(v->value, chanvars);
- } else if ( !strcasecmp(v->name, "parkinglot")) {
- ast_copy_string(parkinglot, v->value, sizeof(parkinglot));
} else if (!strcasecmp(v->name, "speeddial")) {
if (!(sd = ast_calloc(1, sizeof(*sd)))) {
return NULL;
@@ -3109,25 +3030,13 @@ static struct skinny_device *build_device(const char *cat, struct ast_variable *
ast_copy_string(l->cid_num, cid_num, sizeof(l->cid_num));
ast_copy_string(l->cid_name, cid_name, sizeof(l->cid_name));
ast_copy_string(l->label, linelabel, sizeof(l->label));
- ast_copy_string(l->parkinglot, parkinglot, sizeof(l->parkinglot));
ast_copy_string(l->language, language, sizeof(l->language));
ast_copy_string(l->mohinterpret, mohinterpret, sizeof(l->mohinterpret));
ast_copy_string(l->mohsuggest, mohsuggest, sizeof(l->mohsuggest));
ast_copy_string(l->regexten, regexten, sizeof(l->regexten));
ast_copy_string(l->mailbox, mailbox, sizeof(l->mailbox));
- if (!ast_strlen_zero(mailbox)) {
- char *cfg_mailbox, *cfg_context;
- cfg_context = cfg_mailbox = ast_strdupa(l->mailbox);
- ast_verb(3, "Setting mailbox '%s' on %s@%s\n", cfg_mailbox, d->name, l->name);
- strsep(&cfg_context, "@");
- if (ast_strlen_zero(cfg_context))
- cfg_context = "default";
- l->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, NULL,
- AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, cfg_mailbox,
- AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, cfg_context,
- AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
- AST_EVENT_IE_END);
- }
+ if (!ast_strlen_zero(mailbox))
+ ast_verb(3, "Setting mailbox '%s' on %s@%s\n", mailbox, d->name, l->name);
ast_copy_string(l->vmexten, device_vmexten, sizeof(vmexten));
l->chanvars = chanvars;
l->msgstate = -1;
@@ -3240,9 +3149,6 @@ static void *skinny_newcall(void *data)
l->hidecallerid ? "" : l->cid_name,
c->cid.cid_ani ? NULL : l->cid_num);
ast_setstate(c, AST_STATE_RING);
- if (!sub->rtp) {
- start_rtp(sub);
- }
res = ast_pbx_run(c);
if (res) {
ast_log(LOG_WARNING, "PBX exited non-zero\n");
@@ -3419,7 +3325,7 @@ static int skinny_hangup(struct ast_channel *ast)
d = l->parent;
s = d->session;
if (skinnydebug)
- ast_verb(1, "skinny_hangup(%s) on %s@%s\n", ast->name, l->name, d->name);
+ ast_debug(1, "skinny_hangup(%s) on %s@%s\n", ast->name, l->name, d->name);
if (d->registered) {
if ((l->type = TYPE_LINE) && (l->hookstate == SKINNY_OFFHOOK)) {
@@ -3464,7 +3370,7 @@ static int skinny_answer(struct ast_channel *ast)
start_rtp(sub);
}
if (skinnydebug)
- ast_verb(1, "skinny_answer(%s) on %s@%s-%d\n", ast->name, l->name, d->name, sub->callid);
+ ast_debug(1, "skinny_answer(%s) on %s@%s-%d\n", ast->name, l->name, d->name, sub->callid);
if (ast->_state != AST_STATE_UP) {
ast_setstate(ast, AST_STATE_UP);
}
@@ -3697,61 +3603,45 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
case AST_CONTROL_RINGING:
if (ast->_state != AST_STATE_UP) {
if (!sub->progress) {
- if (!d->earlyrtp) {
- transmit_tone(s, SKINNY_ALERT, l->instance, sub->callid);
- }
+ transmit_tone(s, SKINNY_ALERT, l->instance, sub->callid);
transmit_callstate(s, l->instance, SKINNY_RINGOUT, sub->callid);
transmit_dialednumber(s, exten, l->instance, sub->callid);
transmit_displaypromptstatus(s, "Ring Out", 0, l->instance, sub->callid);
transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, exten, exten, l->instance, sub->callid, 2); /* 2 = outgoing from phone */
sub->ringing = 1;
- if (!d->earlyrtp) {
- break;
- }
+ break;
}
}
- return -1; /* Tell asterisk to provide inband signalling */
+ return -1;
case AST_CONTROL_BUSY:
if (ast->_state != AST_STATE_UP) {
- if (!d->earlyrtp) {
- transmit_tone(s, SKINNY_BUSYTONE, l->instance, sub->callid);
- }
+ transmit_tone(s, SKINNY_BUSYTONE, l->instance, sub->callid);
transmit_callstate(s, l->instance, SKINNY_BUSY, sub->callid);
sub->alreadygone = 1;
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
- if (!d->earlyrtp) {
- break;
- }
+ break;
}
- return -1; /* Tell asterisk to provide inband signalling */
+ return -1;
case AST_CONTROL_CONGESTION:
if (ast->_state != AST_STATE_UP) {
- if (!d->earlyrtp) {
- transmit_tone(s, SKINNY_REORDER, l->instance, sub->callid);
- }
+ transmit_tone(s, SKINNY_REORDER, l->instance, sub->callid);
transmit_callstate(s, l->instance, SKINNY_CONGESTION, sub->callid);
sub->alreadygone = 1;
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
- if (!d->earlyrtp) {
- break;
- }
+ break;
}
- return -1; /* Tell asterisk to provide inband signalling */
+ return -1;
case AST_CONTROL_PROGRESS:
if ((ast->_state != AST_STATE_UP) && !sub->progress && !sub->outgoing) {
- if (!d->earlyrtp) {
- transmit_tone(s, SKINNY_ALERT, l->instance, sub->callid);
- }
+ transmit_tone(s, SKINNY_ALERT, l->instance, sub->callid);
transmit_callstate(s, l->instance, SKINNY_PROGRESS, sub->callid);
transmit_displaypromptstatus(s, "Call Progress", 0, l->instance, sub->callid);
transmit_callinfo(s, ast->cid.cid_name, ast->cid.cid_num, exten, exten, l->instance, sub->callid, 2); /* 2 = outgoing from phone */
sub->progress = 1;
- if (!d->earlyrtp) {
- break;
- }
+ break;
}
- return -1; /* Tell asterisk to provide inband signalling */
- case -1: /* STOP_TONE */
+ return -1;
+ case -1:
transmit_tone(s, SKINNY_SILENCE, l->instance, sub->callid);
break;
case AST_CONTROL_HOLD:
@@ -3767,7 +3657,7 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
break;
default:
ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
- return -1; /* Tell asterisk to provide inband signalling */
+ return -1;
}
return 0;
}
@@ -3811,7 +3701,7 @@ static struct ast_channel *skinny_new(struct skinny_line *l, int state)
tmp->nativeformats = default_capability;
fmt = ast_best_codec(tmp->nativeformats);
if (skinnydebug)
- ast_verb(1, "skinny_new: tmp->nativeformats=%d fmt=%d\n", tmp->nativeformats, fmt);
+ ast_debug(1, "skinny_new: tmp->nativeformats=%d fmt=%d\n", tmp->nativeformats, fmt);
if (sub->rtp) {
ast_channel_set_fd(tmp, 0, ast_rtp_fd(sub->rtp));
}
@@ -3883,7 +3773,7 @@ static int skinny_hold(struct skinny_subchannel *sub)
/* Channel needs to be put on hold */
if (skinnydebug)
- ast_verb(1, "Putting on Hold(%d)\n", l->instance);
+ ast_debug(1, "Putting on Hold(%d)\n", l->instance);
ast_queue_control_data(sub->owner, AST_CONTROL_HOLD,
S_OR(l->mohsuggest, NULL),
@@ -3927,7 +3817,7 @@ static int skinny_unhold(struct skinny_subchannel *sub)
/* Channel is on hold, so we will unhold */
if (skinnydebug)
- ast_verb(1, "Taking off Hold(%d)\n", l->instance);
+ ast_debug(1, "Taking off Hold(%d)\n", l->instance);
ast_queue_control(sub->owner, AST_CONTROL_UNHOLD);
@@ -3984,7 +3874,7 @@ static int handle_register_message(struct skinny_req *req, struct skinnysession
req->data.regack.secondaryKeepAlive = htolel(keep_alive);
transmit_response(s, req);
if (skinnydebug)
- ast_verb(1, "Requesting capabilities\n");
+ ast_debug(1, "Requesting capabilities\n");
if (!(req = req_alloc(0, CAPABILITIES_REQ_MESSAGE)))
return -1;
@@ -4008,7 +3898,7 @@ static int handle_callforward_button(struct skinny_subchannel *sub, int cfwdtype
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
}
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
if (l->cfwdtype & cfwdtype) {
@@ -4104,7 +3994,7 @@ static int handle_keypad_button_message(struct skinny_req *req, struct skinnyses
}
} else {
if (skinnydebug)
- ast_verb(1, "No owner: %s\n", l->name);
+ ast_debug(1, "No owner: %s\n", l->name);
}
return 1;
}
@@ -4126,7 +4016,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
instance = letohl(req->data.stimulus.stimulusInstance);
callreference = letohl(req->data.stimulus.callreference);
if (skinnydebug)
- ast_verb(1, "callreference in handle_stimulus_message is '%d'\n", callreference);
+ ast_debug(1, "callreference in handle_stimulus_message is '%d'\n", callreference);
/* Note that this call should be using the passed in instance and callreference */
sub = find_subchannel_by_instance_reference(d, d->lastlineinstance, d->lastcallreference);
@@ -4143,7 +4033,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
switch(event) {
case STIMULUS_REDIAL:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Redial(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Redial(%d/%d)\n", instance, callreference);
if (ast_strlen_zero(l->lastnumberdialed)) {
ast_log(LOG_WARNING, "Attempted redial, but no previously dialed number found.\n");
@@ -4164,7 +4054,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
}
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_RINGOUT);
@@ -4184,7 +4074,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
struct skinny_speeddial *sd;
if (skinnydebug)
- ast_verb(1, "Received Stimulus: SpeedDial(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: SpeedDial(%d/%d)\n", instance, callreference);
if (!(sd = find_speeddial_by_instance(d, instance, 0))) {
return 0;
}
@@ -4205,7 +4095,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
}
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_RINGOUT);
@@ -4228,7 +4118,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
case STIMULUS_HOLD:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Hold(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Hold(%d/%d)\n", instance, callreference);
if (!sub)
break;
@@ -4241,17 +4131,17 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
case STIMULUS_TRANSFER:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Transfer(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Transfer(%d/%d)\n", instance, callreference);
/* XXX figure out how to transfer */
break;
case STIMULUS_CONFERENCE:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Conference(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Conference(%d/%d)\n", instance, callreference);
/* XXX determine the best way to pull off a conference. Meetme? */
break;
case STIMULUS_VOICEMAIL:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Voicemail(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Voicemail(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
c = skinny_new(l, AST_STATE_DOWN);
@@ -4274,7 +4164,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
}
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
@@ -4297,12 +4187,12 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
case STIMULUS_CALLPARK:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Park Call(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Park Call(%d/%d)\n", instance, callreference);
/* XXX Park the call */
break;
case STIMULUS_DND:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: DND (%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: DND (%d/%d)\n", instance, callreference);
/* Do not disturb */
if (l->dnd != 0){
@@ -4319,7 +4209,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
case STIMULUS_FORWARDALL:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Forward All(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Forward All(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
c = skinny_new(l, AST_STATE_DOWN);
@@ -4336,7 +4226,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
case STIMULUS_FORWARDBUSY:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Forward Busy (%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Forward Busy (%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
c = skinny_new(l, AST_STATE_DOWN);
@@ -4353,7 +4243,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
case STIMULUS_FORWARDNOANSWER:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Forward No Answer (%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Forward No Answer (%d/%d)\n", instance, callreference);
#if 0 /* Not sure how to handle this yet */
if (!sub || !sub->owner) {
@@ -4373,11 +4263,11 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
case STIMULUS_DISPLAY:
/* Not sure what this is */
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Display(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Display(%d/%d)\n", instance, callreference);
break;
case STIMULUS_LINE:
if (skinnydebug)
- ast_verb(1, "Received Stimulus: Line(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Stimulus: Line(%d/%d)\n", instance, callreference);
l = find_line_by_instance(d, instance);
@@ -4413,7 +4303,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
sub = c->tech_pvt;
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_OFFHOOK);
@@ -4431,7 +4321,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
break;
default:
if (skinnydebug)
- ast_verb(1, "RECEIVED UNKNOWN STIMULUS: %d(%d/%d)\n", event, instance, callreference);
+ ast_debug(1, "RECEIVED UNKNOWN STIMULUS: %d(%d/%d)\n", event, instance, callreference);
break;
}
ast_device_state_changed("Skinny/%s@%s", l->name, d->name);
@@ -4492,7 +4382,7 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession *
sub = c->tech_pvt;
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_OFFHOOK);
@@ -4543,7 +4433,7 @@ static int handle_onhook_message(struct skinny_req *req, struct skinnysession *s
sub->cxmode = SKINNY_CX_RECVONLY;
transmit_callstate(s, l->instance, l->hookstate, sub->callid);
if (skinnydebug)
- ast_verb(1, "Skinny %s@%s went on hook\n", l->name, d->name);
+ ast_debug(1, "Skinny %s@%s went on hook\n", l->name, d->name);
if (l->transfer && (sub->owner && sub->next && sub->next->owner) && ((!sub->outgoing) || (sub->next && !sub->next->outgoing))) {
/* We're allowed to transfer, we have two active calls and
we made at least one of the calls. Let's try and transfer */
@@ -4552,7 +4442,7 @@ static int handle_onhook_message(struct skinny_req *req, struct skinnysession *s
if ((res = attempt_transfer(p)) < 0) {
if (sub->next && sub->next->owner) {
sub->next->alreadygone = 1;
- ast_queue_hangup(sub->next->owner, -1);
+ ast_queue_hangup(sub->next->owner,1);
}
} else if (res) {
ast_log(LOG_WARNING, "Transfer attempt failed\n");
@@ -4596,7 +4486,7 @@ static int handle_capabilities_res_message(struct skinny_req *req, struct skinny
scodec = letohl(req->data.caps.caps[i].codec);
acodec = codec_skinny2ast(scodec);
if (skinnydebug)
- ast_verb(1, "Adding codec capability '%d (%d)'\n", acodec, scodec);
+ ast_debug(1, "Adding codec capability '%d (%d)'\n", acodec, scodec);
codecs |= acodec;
}
@@ -4837,7 +4727,7 @@ static int handle_button_template_req_message(struct skinny_req *req, struct ski
req->data.buttontemplate.totalButtonCount = htolel(buttonCount);
if (skinnydebug)
- ast_verb(1, "Sending %d template to %s\n",
+ ast_debug(1, "Sending %d template to %s\n",
d->type,
d->name);
transmit_response(s, req);
@@ -4873,7 +4763,7 @@ static int handle_alarm_message(struct skinny_req *req, struct skinnysession *s)
{
/* no response necessary */
if (skinnydebug)
- ast_verb(1, "Received Alarm Message: %s\n", req->data.alarm.displayMessage);
+ ast_debug(1, "Received Alarm Message: %s\n", req->data.alarm.displayMessage);
return 1;
}
@@ -4920,7 +4810,7 @@ static int handle_open_receive_channel_ack_message(struct skinny_req *req, struc
}
if (skinnydebug)
- ast_verb(1, "ipaddr = %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
+ ast_debug(1, "ipaddr = %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
if (!(req = req_alloc(sizeof(struct start_media_transmission_message), START_MEDIA_TRANSMISSION_MESSAGE)))
return -1;
@@ -4928,7 +4818,7 @@ static int handle_open_receive_channel_ack_message(struct skinny_req *req, struc
fmt = ast_codec_pref_getsize(&l->prefs, ast_best_codec(l->capability));
if (skinnydebug)
- ast_verb(1, "Setting payloadType to '%d' (%d ms)\n", fmt.bits, fmt.cur_ms);
+ ast_debug(1, "Setting payloadType to '%d' (%d ms)\n", fmt.bits, fmt.cur_ms);
req->data.startmedia.conferenceId = htolel(sub->callid);
req->data.startmedia.passThruPartyId = htolel(sub->callid);
@@ -4954,7 +4844,7 @@ static int handle_enbloc_call_message(struct skinny_req *req, struct skinnysessi
pthread_t t;
if (skinnydebug)
- ast_verb(1, "Received Enbloc Call: %s\n", req->data.enbloccallmessage.calledParty);
+ ast_debug(1, "Received Enbloc Call: %s\n", req->data.enbloccallmessage.calledParty);
sub = find_subchannel_by_instance_reference(d, d->lastlineinstance, d->lastcallreference);
@@ -4977,7 +4867,7 @@ static int handle_enbloc_call_message(struct skinny_req *req, struct skinnysessi
sub = c->tech_pvt;
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
@@ -5055,7 +4945,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
if (!l) {
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: %d(%d/%d)\n", event, instance, callreference);
+ ast_debug(1, "Received Softkey Event: %d(%d/%d)\n", event, instance, callreference);
return 0;
}
@@ -5064,11 +4954,11 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
switch(event) {
case SOFTKEY_NONE:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: None(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: None(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_REDIAL:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Redial(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Redial(%d/%d)\n", instance, callreference);
if (ast_strlen_zero(l->lastnumberdialed)) {
ast_log(LOG_WARNING, "Attempted redial, but no previously dialed number found.\n");
@@ -5094,7 +4984,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid);
}
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_RINGOUT);
@@ -5111,7 +5001,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_NEWCALL: /* Actually the DIAL softkey */
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: New Call(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: New Call(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
c = skinny_new(l, AST_STATE_DOWN);
@@ -5135,7 +5025,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
}
if (skinnydebug)
- ast_verb(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
+ ast_debug(1, "Attempting to Clear display on Skinny %s@%s\n", l->name, d->name);
transmit_displaymessage(s, NULL, l->instance, sub->callid); /* clear display */
transmit_tone(s, SKINNY_DIALTONE, l->instance, sub->callid);
transmit_selectsoftkeys(s, l->instance, sub->callid, KEYDEF_OFFHOOK);
@@ -5149,7 +5039,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_HOLD:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Hold(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Hold(%d/%d)\n", instance, callreference);
if (sub) {
if (sub->onhold) {
@@ -5162,12 +5052,12 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_TRNSFER:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Transfer(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Transfer(%d/%d)\n", instance, callreference);
/* XXX figure out how to transfer */
break;
case SOFTKEY_DND:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: DND(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: DND(%d/%d)\n", instance, callreference);
/* Do not disturb */
if (l->dnd != 0){
@@ -5184,7 +5074,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_CFWDALL:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Forward All(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Forward All(%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
c = skinny_new(l, AST_STATE_DOWN);
@@ -5201,7 +5091,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_CFWDBUSY:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Forward Busy (%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Forward Busy (%d/%d)\n", instance, callreference);
if (!sub || !sub->owner) {
c = skinny_new(l, AST_STATE_DOWN);
@@ -5218,7 +5108,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_CFWDNOANSWER:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Forward No Answer (%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Forward No Answer (%d/%d)\n", instance, callreference);
#if 0 /* Not sure how to handle this yet */
if (!sub || !sub->owner) {
@@ -5237,11 +5127,11 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_BKSPC:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Backspace(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Backspace(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_ENDCALL:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: End Call(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: End Call(%d/%d)\n", instance, callreference);
if (l->hookstate == SKINNY_ONHOOK) {
/* Something else already put us back on hook */
@@ -5252,7 +5142,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
l->hookstate = SKINNY_ONHOOK;
transmit_callstate(s, l->instance, l->hookstate, sub->callid);
if (skinnydebug)
- ast_verb(1, "Skinny %s@%s went on hook\n", l->name, d->name);
+ ast_debug(1, "Skinny %s@%s went on hook\n", l->name, d->name);
if (l->transfer && (sub->owner && sub->next && sub->next->owner) && ((!sub->outgoing) || (sub->next && !sub->next->outgoing))) {
/* We're allowed to transfer, we have two active calls and
we made at least one of the calls. Let's try and transfer */
@@ -5261,7 +5151,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
if ((res = attempt_transfer(p)) < 0) {
if (sub->next && sub->next->owner) {
sub->next->alreadygone = 1;
- ast_queue_hangup(sub->next->owner, -1);
+ ast_queue_hangup(sub->next->owner, 1);
}
} else if (res) {
ast_log(LOG_WARNING, "Transfer attempt failed\n");
@@ -5286,11 +5176,11 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_RESUME:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Resume(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Resume(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_ANSWER:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Answer(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Answer(%d/%d)\n", instance, callreference);
transmit_ringer_mode(s,SKINNY_RING_OFF);
transmit_lamp_indication(s, STIMULUS_LINE, l->instance, SKINNY_LAMP_ON);
@@ -5310,38 +5200,38 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
break;
case SOFTKEY_INFO:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Info(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Info(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_CONFRN:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Conference(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Conference(%d/%d)\n", instance, callreference);
/* XXX determine the best way to pull off a conference. Meetme? */
break;
case SOFTKEY_PARK:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Park Call(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Park Call(%d/%d)\n", instance, callreference);
/* XXX Park the call */
break;
case SOFTKEY_JOIN:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Join(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Join(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_MEETME:
/* XXX How is this different from CONFRN? */
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Meetme(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Meetme(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_PICKUP:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Pickup(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Pickup(%d/%d)\n", instance, callreference);
break;
case SOFTKEY_GPICKUP:
if (skinnydebug)
- ast_verb(1, "Received Softkey Event: Group Pickup(%d/%d)\n", instance, callreference);
+ ast_debug(1, "Received Softkey Event: Group Pickup(%d/%d)\n", instance, callreference);
break;
default:
if (skinnydebug)
- ast_verb(1, "Received unknown Softkey Event: %d(%d/%d)\n", event, instance, callreference);
+ ast_debug(1, "Received unknown Softkey Event: %d(%d/%d)\n", event, instance, callreference);
break;
}
ast_device_state_changed("Skinny/%s@%s", l->name, d->name);
@@ -5397,7 +5287,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
break;
case REGISTER_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Device %s is attempting to register\n", req->data.reg.name);
+ ast_debug(1, "Device %s is attempting to register\n", req->data.reg.name);
res = handle_register_message(req, s);
break;
@@ -5412,7 +5302,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
int callReference;
if (skinnydebug)
- ast_verb(1, "Collected digit: [%d]\n", letohl(req->data.keypad.button));
+ ast_debug(1, "Collected digit: [%d]\n", letohl(req->data.keypad.button));
lineInstance = letohl(req->data.keypad.lineInstance);
callReference = letohl(req->data.keypad.callReference);
@@ -5461,42 +5351,42 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
break;
case CAPABILITIES_RES_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received CapabilitiesRes\n");
+ ast_debug(1, "Received CapabilitiesRes\n");
res = handle_capabilities_res_message(req, s);
break;
case SPEED_DIAL_STAT_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received SpeedDialStatRequest\n");
+ ast_debug(1, "Received SpeedDialStatRequest\n");
res = handle_speed_dial_stat_req_message(req, s);
break;
case LINE_STATE_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received LineStatRequest\n");
+ ast_debug(1, "Received LineStatRequest\n");
res = handle_line_state_req_message(req, s);
break;
case TIME_DATE_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received Time/Date Request\n");
+ ast_debug(1, "Received Time/Date Request\n");
res = handle_time_date_req_message(req, s);
break;
case BUTTON_TEMPLATE_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Buttontemplate requested\n");
+ ast_debug(1, "Buttontemplate requested\n");
res = handle_button_template_req_message(req, s);
break;
case VERSION_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Version Request\n");
+ ast_debug(1, "Version Request\n");
res = handle_version_req_message(req, s);
break;
case SERVER_REQUEST_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received Server Request\n");
+ ast_debug(1, "Received Server Request\n");
res = handle_server_request_message(req, s);
break;
@@ -5505,13 +5395,13 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
break;
case OPEN_RECEIVE_CHANNEL_ACK_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received Open Receive Channel Ack\n");
+ ast_debug(1, "Received Open Receive Channel Ack\n");
res = handle_open_receive_channel_ack_message(req, s);
break;
case SOFT_KEY_SET_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received SoftKeySetReq\n");
+ ast_debug(1, "Received SoftKeySetReq\n");
res = handle_soft_key_set_req_message(req, s);
break;
@@ -5520,13 +5410,13 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
break;
case UNREGISTER_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received Unregister Request\n");
+ ast_debug(1, "Received Unregister Request\n");
res = handle_unregister_message(req, s);
break;
case SOFT_KEY_TEMPLATE_REQ_MESSAGE:
if (skinnydebug)
- ast_verb(1, "Received SoftKey Template Request\n");
+ ast_debug(1, "Received SoftKey Template Request\n");
res = handle_soft_key_template_req_message(req, s);
break;
@@ -5538,7 +5428,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s)
break;
default:
if (skinnydebug)
- ast_verb(1, "RECEIVED UNKNOWN MESSAGE TYPE: %x\n", letohl(req->e));
+ ast_debug(1, "RECEIVED UNKNOWN MESSAGE TYPE: %x\n", letohl(req->e));
break;
}
if (res >= 0 && req)
@@ -5594,7 +5484,7 @@ static int get_input(struct skinnysession *s)
}
} else if (res == 0) {
if (skinnydebug)
- ast_verb(1, "Skinny Client was lost, unregistering\n");
+ ast_debug(1, "Skinny Client was lost, unregistering\n");
skinny_unregister(NULL, s);
return -1;
}
@@ -5607,7 +5497,7 @@ static int get_input(struct skinnysession *s)
ast_log(LOG_WARNING, "read() returned error: %s\n", strerror(errno));
if (skinnydebug)
- ast_verb(1, "Skinny Client was lost, unregistering\n");
+ ast_debug(1, "Skinny Client was lost, unregistering\n");
skinny_unregister(NULL,s);
ast_mutex_unlock(&s->lock);
@@ -5618,7 +5508,7 @@ static int get_input(struct skinnysession *s)
if (res == 0) {
if (skinnydebug)
- ast_verb(1, "Skinny Client was lost, unregistering\n");
+ ast_debug(1, "Skinny Client was lost, unregistering\n");
skinny_unregister(NULL, s);
}
@@ -5747,7 +5637,7 @@ static void *accept_thread(void *ignore)
}
}
if (skinnydebug)
- ast_verb(1, "killing accept thread\n");
+ ast_debug(1, "killing accept thread\n");
close(as);
return 0;
}
@@ -6147,8 +6037,6 @@ static int unload_module(void)
}
ast_mutex_unlock(&sub->lock);
}
- if (l->mwi_event_sub)
- ast_event_unsubscribe(l->mwi_event_sub);
ast_mutex_unlock(&l->lock);
}
}