[Asterisk-cvs] asterisk/channels chan_skinny.c,1.12,1.13
jeremy at lists.digium.com
jeremy at lists.digium.com
Sun Sep 14 10:38:14 CDT 2003
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv23459
Modified Files:
chan_skinny.c
Log Message:
minor code fixes
Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- chan_skinny.c 14 Sep 2003 04:03:28 -0000 1.12
+++ chan_skinny.c 14 Sep 2003 15:39:22 -0000 1.13
@@ -1426,16 +1426,16 @@
struct skinny_line *l;
struct skinny_subchannel *sub;
struct skinnysession *session;
-
- sub = ast->pvt->pvt;
- l = sub->parent;
- session = l->parent->session;
+
+ sub = ast->pvt->pvt;
+ l = sub->parent;
+ session = l->parent->session;
- if (!l->parent->registered) {
- ast_log(LOG_ERROR, "Device not registered, cannot call %s\n", dest);
- return -1;
- }
-
+ if (!l->parent->registered) {
+ ast_log(LOG_ERROR, "Device not registered, cannot call %s\n", dest);
+ return -1;
+ }
+
if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
ast_log(LOG_WARNING, "skinny_call called on %s, neither down nor reserved\n", ast->name);
return -1;
@@ -1512,25 +1512,25 @@
struct skinny_line *l = sub->parent;
struct skinnysession *s = l->parent->session;
- if (skinnydebug) {
- ast_verbose("skinny_hangup(%s) on %s@%s\n", ast->name, l->name, l->parent->name);
- }
- if (!ast->pvt->pvt) {
- ast_log(LOG_DEBUG, "Asked to hangup channel not connected\n");
- return 0;
- }
-
- if (l->parent->registered) {
+ if (skinnydebug) {
+ ast_verbose("skinny_hangup(%s) on %s@%s\n", ast->name, l->name, l->parent->name);
+ }
+ if (!ast->pvt->pvt) {
+ ast_log(LOG_DEBUG, "Asked to hangup channel not connected\n");
+ return 0;
+ }
+
+ if (l->parent->registered) {
if ((sub->parent->type = TYPE_LINE) && (sub->parent->hookstate == SKINNY_OFFHOOK)) {
sub->parent->hookstate = SKINNY_ONHOOK;
transmit_callstate(s, l->instance, SKINNY_ONHOOK, sub->callid);
transmit_speaker_mode(s, SKINNY_SPEAKEROFF);
- } else if ((sub->parent->type = TYPE_LINE) && (sub->parent->hookstate == SKINNY_ONHOOK)) {
- transmit_callstate(s, l->instance, SKINNY_ONHOOK, sub->callid);
- transmit_speaker_mode(s, SKINNY_SPEAKEROFF);
- transmit_ringer_mode(s, SKINNY_RING_OFF);
- transmit_tone(s, SKINNY_SILENCE);
- }
+ } else if ((sub->parent->type = TYPE_LINE) && (sub->parent->hookstate == SKINNY_ONHOOK)) {
+ transmit_callstate(s, l->instance, SKINNY_ONHOOK, sub->callid);
+ transmit_speaker_mode(s, SKINNY_SPEAKEROFF);
+ transmit_ringer_mode(s, SKINNY_RING_OFF);
+ transmit_tone(s, SKINNY_SILENCE);
+ }
}
ast_mutex_lock(&sub->lock);
sub->owner = NULL;
@@ -1639,11 +1639,10 @@
static int skinny_senddigit(struct ast_channel *ast, char digit)
{
-// struct skinny_subchannel *sub = ast->pvt->pvt;
- char tmp[2];
- tmp[0] = digit;
- tmp[1] = '\0';
-// transmit_notify_request(sub, tmp);
+ struct skinny_subchannel *sub = ast->pvt->pvt;
+// int tmp;
+// sprintf(tmp, "%d", digit); // not right
+// transmit_tone(sub->parent->parent->session, digit);
return -1;
}
@@ -2138,7 +2137,8 @@
sprintf(&d, "%d", digit);
}
f.subclass = d;
- f.src = "skinny";
+ f.src = "skinny";
+
sub = find_subchannel_by_line(s->device->lines);
if (sub->owner) {
@@ -2473,7 +2473,7 @@
if (gethostname(ourhost, sizeof(ourhost))) {
ast_log(LOG_WARNING, "Unable to get hostname, Skinny disabled\n");
- return 0;
+ return 1;
}
cfg = ast_load(config);
@@ -2636,13 +2636,13 @@
int reload(void)
{
-#if 0
-// XXX Causes Seg
-
+#if 0
+// XXX Causes Seg
+
delete_devices();
reload_config();
restart_monitor();
-#endif
+#endif
return 0;
}
More information about the svn-commits
mailing list