Merged revisions 77890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #10291) ........ r77890 | qwell | 2007-08-01 17:28:56 -0500 (Wed, 01 Aug 2007) | 4 lines Put in some additional debug information for softkey/stimulus messages. Issue 10291, patch by DEA. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77891 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
37f2a147df
commit
ea685dcaa0
1 changed files with 44 additions and 43 deletions
|
@ -196,7 +196,7 @@ struct enbloc_call_message {
|
|||
struct stimulus_message {
|
||||
uint32_t stimulus;
|
||||
uint32_t stimulusInstance;
|
||||
uint32_t unknown1;
|
||||
uint32_t callreference;
|
||||
};
|
||||
|
||||
#define OFFHOOK_MESSAGE 0x0006
|
||||
|
@ -263,7 +263,7 @@ struct open_receive_channel_ack_message {
|
|||
struct soft_key_event_message {
|
||||
uint32_t softKeyEvent;
|
||||
uint32_t instance;
|
||||
uint32_t reference;
|
||||
uint32_t callreference;
|
||||
};
|
||||
|
||||
#define UNREGISTER_MESSAGE 0x0027
|
||||
|
@ -3286,15 +3286,16 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
pthread_t t;
|
||||
int event;
|
||||
int instance;
|
||||
int unknown1;
|
||||
int callreference;
|
||||
/*int res = 0;*/
|
||||
|
||||
event = letohl(req->data.stimulus.stimulus);
|
||||
instance = letohl(req->data.stimulus.stimulusInstance);
|
||||
unknown1 = letohl(req->data.stimulus.unknown1); /* No clue.. */
|
||||
callreference = letohl(req->data.stimulus.callreference);
|
||||
if (skinnydebug)
|
||||
ast_verbose("unknown1 in handle_stimulus_message is '%d'\n", unknown1);
|
||||
ast_verbose("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);
|
||||
|
||||
if (!sub) {
|
||||
|
@ -3309,7 +3310,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
switch(event) {
|
||||
case STIMULUS_REDIAL:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Redial(%d)\n", instance);
|
||||
ast_verbose("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");
|
||||
|
@ -3350,7 +3351,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
struct skinny_speeddial *sd;
|
||||
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: SpeedDial(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: SpeedDial(%d/%d)\n", instance, callreference);
|
||||
if (!(sd = find_speeddial_by_instance(d, instance, 0))) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -3394,7 +3395,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
break;
|
||||
case STIMULUS_HOLD:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Hold(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Hold(%d/%d)\n", instance, callreference);
|
||||
|
||||
if (!sub)
|
||||
break;
|
||||
|
@ -3407,17 +3408,17 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
break;
|
||||
case STIMULUS_TRANSFER:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Transfer(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Transfer(%d/%d)\n", instance, callreference);
|
||||
/* XXX figure out how to transfer */
|
||||
break;
|
||||
case STIMULUS_CONFERENCE:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Conference(%d)\n", instance);
|
||||
ast_verbose("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_verbose("Received Stimulus: Voicemail(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Voicemail(%d/%d)\n", instance, callreference);
|
||||
|
||||
if (!sub || !sub->owner) {
|
||||
c = skinny_new(l, AST_STATE_DOWN);
|
||||
|
@ -3463,12 +3464,12 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
break;
|
||||
case STIMULUS_CALLPARK:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Park Call(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Park Call(%d/%d)\n", instance, callreference);
|
||||
/* XXX Park the call */
|
||||
break;
|
||||
case STIMULUS_FORWARDALL:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Forward All(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Forward All(%d/%d)\n", instance, callreference);
|
||||
/* Why is DND under FORWARDALL? */
|
||||
/* Because it's the same thing. */
|
||||
|
||||
|
@ -3487,20 +3488,20 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
break;
|
||||
case STIMULUS_FORWARDBUSY:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Forward Busy (%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Forward Busy (%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case STIMULUS_FORWARDNOANSWER:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Forward No Answer (%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Forward No Answer (%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case STIMULUS_DISPLAY:
|
||||
/* Not sure what this is */
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Display(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Display(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case STIMULUS_LINE:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Stimulus: Line(%d)\n", instance);
|
||||
ast_verbose("Received Stimulus: Line(%d/%d)\n", instance, callreference);
|
||||
|
||||
l = find_line_by_instance(d, instance);
|
||||
|
||||
|
@ -3554,7 +3555,7 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession
|
|||
break;
|
||||
default:
|
||||
if (skinnydebug)
|
||||
ast_verbose("RECEIVED UNKNOWN STIMULUS: %d(%d)\n", event, instance);
|
||||
ast_verbose("RECEIVED UNKNOWN STIMULUS: %d(%d/%d)\n", event, instance, callreference);
|
||||
break;
|
||||
}
|
||||
ast_device_state_changed("Skinny/%s@%s", l->name, d->name);
|
||||
|
@ -4157,16 +4158,16 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
pthread_t t;
|
||||
int event;
|
||||
int instance;
|
||||
int reference;
|
||||
int callreference;
|
||||
|
||||
event = letohl(req->data.softkeyeventmessage.softKeyEvent);
|
||||
instance = letohl(req->data.softkeyeventmessage.instance);
|
||||
reference = letohl(req->data.softkeyeventmessage.reference);
|
||||
callreference = letohl(req->data.softkeyeventmessage.callreference);
|
||||
|
||||
if (instance) {
|
||||
l = find_line_by_instance(d, instance);
|
||||
if (reference) {
|
||||
sub = find_subchannel_by_instance_reference(d, instance, reference);
|
||||
if (callreference) {
|
||||
sub = find_subchannel_by_instance_reference(d, instance, callreference);
|
||||
} else {
|
||||
sub = find_subchannel_by_instance_reference(d, instance, d->lastcallreference);
|
||||
}
|
||||
|
@ -4176,7 +4177,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
|
||||
if (!l) {
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: %d(%d)\n", event, instance);
|
||||
ast_verbose("Received Softkey Event: %d(%d/%d)\n", event, instance, callreference);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4185,11 +4186,11 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
switch(event) {
|
||||
case SOFTKEY_NONE:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: None(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: None(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_REDIAL:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Redial(%d)\n", instance);
|
||||
ast_verbose("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");
|
||||
|
@ -4232,7 +4233,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_verbose("Received Softkey Event: New Call(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: New Call(%d/%d)\n", instance, callreference);
|
||||
|
||||
if (!sub || !sub->owner) {
|
||||
c = skinny_new(l, AST_STATE_DOWN);
|
||||
|
@ -4270,7 +4271,7 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
break;
|
||||
case SOFTKEY_HOLD:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Hold(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Hold(%d/%d)\n", instance, callreference);
|
||||
|
||||
if (sub) {
|
||||
if (sub->onhold) {
|
||||
|
@ -4283,12 +4284,12 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
break;
|
||||
case SOFTKEY_TRNSFER:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Transfer(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Transfer(%d/%d)\n", instance, callreference);
|
||||
/* XXX figure out how to transfer */
|
||||
break;
|
||||
case SOFTKEY_CFWDALL:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Forward All(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Forward All(%d/%d)\n", instance, callreference);
|
||||
|
||||
/* Do not disturb */
|
||||
if (l->dnd != 0){
|
||||
|
@ -4305,19 +4306,19 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
break;
|
||||
case SOFTKEY_CFWDBUSY:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Forward Busy (%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Forward Busy (%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_CFWDNOANSWER:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Forward No Answer (%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Forward No Answer (%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_BKSPC:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Backspace(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Backspace(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_ENDCALL:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: End Call(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: End Call(%d/%d)\n", instance, callreference);
|
||||
|
||||
if (l->hookstate == SKINNY_ONHOOK) {
|
||||
/* Something else already put us back on hook */
|
||||
|
@ -4362,11 +4363,11 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
break;
|
||||
case SOFTKEY_RESUME:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Resume(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Resume(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_ANSWER:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Answer(%d)\n", instance);
|
||||
ast_verbose("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);
|
||||
|
@ -4386,38 +4387,38 @@ static int handle_soft_key_event_message(struct skinny_req *req, struct skinnyse
|
|||
break;
|
||||
case SOFTKEY_INFO:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Info(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Info(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_CONFRN:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Conference(%d)\n", instance);
|
||||
ast_verbose("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_verbose("Received Softkey Event: Park Call(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Park Call(%d/%d)\n", instance, callreference);
|
||||
/* XXX Park the call */
|
||||
break;
|
||||
case SOFTKEY_JOIN:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Join(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Join(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_MEETME:
|
||||
/* XXX How is this different from CONFRN? */
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Meetme(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Meetme(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_PICKUP:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Pickup(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Pickup(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
case SOFTKEY_GPICKUP:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received Softkey Event: Group Pickup(%d)\n", instance);
|
||||
ast_verbose("Received Softkey Event: Group Pickup(%d/%d)\n", instance, callreference);
|
||||
break;
|
||||
default:
|
||||
if (skinnydebug)
|
||||
ast_verbose("Received unknown Softkey Event: %d(%d)\n", event, instance);
|
||||
ast_verbose("Received unknown Softkey Event: %d(%d/%d)\n", event, instance, callreference);
|
||||
break;
|
||||
}
|
||||
ast_device_state_changed("Skinny/%s@%s", l->name, d->name);
|
||||
|
|
Reference in a new issue