Index: channels/chan_skinny.c =================================================================== --- channels/chan_skinny.c (revision 62093) +++ channels/chan_skinny.c (working copy) @@ -98,6 +98,7 @@ #define SKINNY_MAX_PACKET 1000 static int keep_alive = 120; +static char vmaccess[32]; /* Voicemail pilot number */ static char date_format[6] = "D-M-Y"; static char version_id[16] = "P002F202"; @@ -3026,12 +3027,13 @@ if (skinnydebug) ast_verbose("Received Stimulus: Redial(%d)\n", instance); -#if 0 c = skinny_new(l, AST_STATE_DOWN); if(!c) { ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name); } else { sub = c->tech_pvt; + l = sub->parent; + l->hookstate = SKINNY_OFFHOOK; transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid); if (skinnydebug) ast_verbose("Attempting to Clear display on Skinny %s@%s\n", l->name, d->name); @@ -3051,42 +3053,43 @@ ast_hangup(c); } } -#endif break; case STIMULUS_SPEEDDIAL: if (skinnydebug) ast_verbose("Received Stimulus: SpeedDial(%d)\n", instance); -#if 0 + struct skinny_speeddial *sd; if (!(sd = find_speeddial_by_instance(d, instance))) { return 0; } c = skinny_new(l, AST_STATE_DOWN); - if(c) { + if(!c) { + ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name); + } else { sub = c->tech_pvt; l = sub->parent; + l->hookstate = SKINNY_OFFHOOK; transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid); if (skinnydebug) ast_verbose("Attempting to Clear display on Skinny %s@%s\n", l->name, d->name); transmit_displaymessage(s, NULL); /* clear display */ transmit_tone(s, SKINNY_DIALTONE); - if (!ast_ignore_pattern(c->context, sd->exten)) { transmit_tone(s, SKINNY_SILENCE); } if (ast_exists_extension(c, c->context, sd->exten, 1, l->cid_num)) { - if (!ast_matchmore_extension(c, c->context, sd->exten, 1, l->cid_num)) { + //if (!ast_matchmore_extension(c, c->context, sd->exten, 1, l->cid_num)) { ast_copy_string(c->exten, sd->exten, sizeof(c->exten)); ast_copy_string(l->lastnumberdialed, sd->exten, sizeof(l->lastnumberdialed)); - skinny_newcall(c); + if (ast_pthread_create(&t, NULL, skinny_newcall, c)) { + ast_log(LOG_WARNING, "Unable to create new call thread: %s\n", strerror(errno)); + ast_hangup(c); + } break; - } + //} } - } else { - ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name); } -#endif break; case STIMULUS_HOLD: if (skinnydebug) @@ -3116,7 +3119,34 @@ case STIMULUS_VOICEMAIL: if (skinnydebug) ast_verbose("Received Stimulus: Voicemail(%d)\n", instance); - /* XXX Find and dial voicemail extension */ + + c = skinny_new(l, AST_STATE_DOWN); + if(!c) { + ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name); + } else { + sub = c->tech_pvt; + l = sub->parent; + l->hookstate = SKINNY_OFFHOOK; + transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid); + if (skinnydebug) + ast_verbose("Attempting to Clear display on Skinny %s@%s\n", l->name, d->name); + transmit_displaymessage(s, NULL); /* clear display */ + transmit_tone(s, SKINNY_DIALTONE); + if (!ast_ignore_pattern(c->context, vmaccess)) { + transmit_tone(s, SKINNY_SILENCE); + } + if (ast_exists_extension(c, c->context, vmaccess, 1, l->cid_num)) { + //if (!ast_matchmore_extension(c, c->context, sd->exten, 1, l->cid_num)) { + ast_copy_string(c->exten, vmaccess, sizeof(c->exten)); + ast_copy_string(l->lastnumberdialed, vmaccess, sizeof(l->lastnumberdialed)); + if (ast_pthread_create(&t, NULL, skinny_newcall, c)) { + ast_log(LOG_WARNING, "Unable to create new call thread: %s\n", strerror(errno)); + ast_hangup(c); + } + break; + //} + } + } break; case STIMULUS_CALLPARK: if (skinnydebug) @@ -3745,7 +3775,6 @@ if (skinnydebug) ast_verbose("Received Softkey Event: Redial(%d)\n", instance); -#if 0 if (!sub || !sub->owner) { c = skinny_new(l, AST_STATE_DOWN); } else { @@ -3756,6 +3785,7 @@ ast_log(LOG_WARNING, "Unable to create channel for %s@%s\n", l->name, d->name); } else { sub = c->tech_pvt; + l->hookstate = SKINNY_OFFHOOK; transmit_callstate(s, l->instance, SKINNY_OFFHOOK, sub->callid); if (skinnydebug) ast_verbose("Attempting to Clear display on Skinny %s@%s\n", l->name, d->name); @@ -3775,9 +3805,8 @@ ast_hangup(c); } } -#endif break; - case SOFTKEY_NEWCALL: + case SOFTKEY_NEWCALL: /* Actually the DIAL softkey */ /* XXX Untested */ if (skinnydebug) ast_verbose("Received Softkey Event: New Call(%d)\n", instance); @@ -4461,6 +4490,8 @@ } } else if (!strcasecmp(v->name, "keepalive")) { keep_alive = atoi(v->value); + } else if (!strcasecmp(v->name, "vmaccess")) { + ast_copy_string(vmaccess, v->value, sizeof(vmaccess)); } else if (!strcasecmp(v->name, "dateformat")) { ast_copy_string(date_format, v->value, sizeof(date_format)); } else if (!strcasecmp(v->name, "allow")) { Index: configs/skinny.conf.sample =================================================================== --- configs/skinny.conf.sample (revision 62093) +++ configs/skinny.conf.sample (working copy) @@ -7,6 +7,10 @@ dateformat=M-D-Y ; M,D,Y in any order (5 chars max) keepalive=120 +;vmaccess=8500 ; Systemwide voicemailmain pilot number + ; It must be in the same context as the calling + ; device/line + ;allow=all ; see doc/rtp-packetization for framing options ;disallow=