Idefisk
Tools
Tutorials
Reviews
VoIP Providers
Archives
AsteriskGuru Archives
Mailing List Archives
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
[Asterisk-cvs] asterisk/channels chan_skinny.c,1.9,1.10
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
View previous topic
::
View next topic
Author
Message
jeremy at lists.digium.co
Guest
Posted: Sun Sep 14, 2003 2:16 am
Post subject: [Asterisk-cvs] asterisk/channels chan_skinny.c,1.9,1.10
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv30233
Modified Files:
chan_skinny.c
Log Message:
stomp on seg fault if a call is attempted and the skinny device is not registered
Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- chan_skinny.c 14 Sep 2003 01:50:00 -0000 1.9
+++ chan_skinny.c 14 Sep 2003 02:17:32 -0000 1.10
@@ -1438,6 +1438,15 @@
struct skinny_subchannel *sub;
struct skinnysession *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 ((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;
@@ -1446,14 +1455,10 @@
if (skinnydebug) {
ast_verbose(VERBOSE_PREFIX_3 "skinny_call(%s)\n", ast->name);
}
-
- sub = ast->pvt->pvt;
- l = sub->parent;
- session = l->parent->session;
if (l->dnd) {
ast_queue_control(ast, AST_CONTROL_BUSY, 0);
- return 0;
+ return -1;
}
switch (l->hookstate) {
@@ -1525,18 +1530,19 @@
ast_log(LOG_DEBUG, "Asked to hangup channel not connected\n");
return 0;
}
- 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);
- }
-
+ 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);
+ }
+ }
ast_mutex_lock(&sub->lock);
sub->owner = NULL;
ast->pvt->pvt = NULL;
@@ -2641,13 +2647,13 @@
int reload(void)
{
-#if 0
-// XXX Causes Seg
-
+#if 0
+// XXX Causes Seg
+
delete_devices();
reload_config();
restart_monitor();
-#endif
+#endif
return 0;
}
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
All times are GMT
Page
1
of
1
Jump to:
Select a forum
Asterisk Mailing Lists
----------------
Asterisk-Users
Asterisk-Dev
Asterisk-CVS
Asterisk-Biz
Asterisk-Doc
Asterisk-BSD
Asterisk-Announce
Asterisk Call Centers
Asterisk-Video
Asterisk-Speech-Rec
Bristuff-Users
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
edit your posts in this forum
You
cannot
delete your posts in this forum
You
cannot
vote in polls in this forum
Powered by
phpBB
© 2001, 2005 phpBB Group