From: <bu...@us...> - 2007-04-19 16:13:04
|
Revision: 1394 http://svn.sourceforge.net/yaacs/?rev=1394&view=rev Author: bugant Date: 2007-04-19 09:12:58 -0700 (Thu, 19 Apr 2007) Log Message: ----------- FIX: catch for errors in ::yavoip::_call_NotifyText and set outcome var in order to make scan command happy; FIX: sacn command has to check for result > 0 'cause it returns number of occurrences, i.e. no occurrences == 0 and -1 if the end of the input string is reached before any conversions have been performed... quite annoying. FIX: [important - experimental :)] don't go on with the auto_call proccess if ::yavoip::result is 0, 'cause if it's the case then hang-up button has been pressed, i.e. user want to stop it! Before discovering this we're relying on the fact that 'outcome: 0' text message was sended from asterisk, obviuosly this's not true in fact on hang-up press we send a dump call command and (I suppose) the iax channel will be closed. To re-produce the bug you can try this with a previous revision (i.e the one before this) from yacati: 1) build a database full of contact with the same phone number setted in the active_phone 2) start yacati in auto_call mode for the project 3) set the number you choosed to call as busy 4) try to stop the auto-call proccess Modified Paths: -------------- trunk/yaacs/yavoip.tcl Modified: trunk/yaacs/yavoip.tcl =================================================================== --- trunk/yaacs/yavoip.tcl 2007-04-19 08:23:10 UTC (rev 1393) +++ trunk/yaacs/yavoip.tcl 2007-04-19 16:12:58 UTC (rev 1394) @@ -104,10 +104,12 @@ # @param callNo # @param msg proc ::yavoip::_call_NotifyText {type callNo msg} { + if [catch { ::yalog::debug "call($callNo) received text: '$msg'" - if {[scan $msg "outcome: %d" outcome] != -1} { + set outcome "" + if {[scan $msg "outcome: %d" outcome] > 0} { set ::yavoip::result $outcome - } + }} err] {::yalog::debug "error on _call_NotifyText: $err"} } ### @@ -138,7 +140,7 @@ ::yalog::debug "auto-mode call($callNo) received text: '$msg'" set outcome "" - if {[scan $msg "outcome: %d" outcome] != -1} { + if {[scan $msg "outcome: %d" outcome] > 0} { if {$outcome == 0} { set ::yavoip::result $outcome } else { @@ -162,7 +164,7 @@ } } - if {[info exists automatic_state]} { + if {[info exists automatic_state] && $::yavoip::result != 0} { ::yalog::debug "hang-up auto call: automatic outcome detected" ::iaxclient::hangup tkwait variable ::yavoip::state @@ -285,6 +287,7 @@ } ::yalog::debug "calling number '$number':" + set ::yavoip::result "" ::iaxclient::dial "$::yavoip::prefs(user):$::yavoip::prefs(pass)@$::yavoip::prefs(server)/$number@$::yavoip::prefs(context)" return 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |