[ChanSccpB] Auto Answer


(Canada) #1

When a user intercoms / pages my Cisco sets they ring but will not auto answer, when picked up the page goes through otherwise the phone hangs up.


Cisco 7962 Stuck on Registering
(Canada) #2

I’ve posted a call event log


(Dave Burgess) #3

I posted this on the old thread. There are some good hints in here.


(Dave Burgess) #4

Found another interesting article about this. The supposition doesn’t sound plausible, but if we have to assume it’s true, you can follow along. I’m all but certain there’s an auto-answer setting in the XML that should be able to control this. The SCCP-Manager from PhantomIV on Github might have a setting for it in the phone manager section.

```
#!/usr/bin/perl

#Set auto_answer on cisco 79xx phone via telnet.
#Hack around the inability of the sip software to set via a config file.

#Public domain, no warranty at all. (http://www.comtek.co.uk)

use Net::Telnet();
use List::Util qw(reduce);
use constant PROMPT => "SIP Phone";
use constant PASSWORD => "roline2";

@to_set=();
@to_unset=();

if((@ARGV<3)||(!(@ARGV%2)))
{
        print "Syntax: set_auto_answer <ip> <list>\n\twhere <list> is a list of "
          ." one or more '<line num> <0|1>'\n"
          ."\nEg: set_auto_answer 1.1.1.1 1 0 2 1\n";
        exit 1;
}
$target_ip=shift;

do
{
        my ($line, $setting)=(shift, shift);
        if($setting)
        {
                push(@to_set, $line);
        }
        else
        {
                push(@to_unset, $line);
        }
}while(@ARGV);

#For logs, use "" or *STDOUT
$t=new Net::Telnet(Timeout => 1, Output_log => "", Input_log => "", Dump_log => "");
$t->open($target_ip);

$t->waitfor('/Password :.*$/');
$t->print(PASSWORD);

$t->waitfor('/'.PROMPT.'>.*$/');

@tmp=$t->cmd("show config");
@tmp=grep(/^auto_answer : /, @tmp);
die("Bad auto_answer")
  if(scalar(@tmp)!=1);

@tmp[0]=~/([0-9]+)/;
$auto_answer=$1;

@to_set=grep {  !(1<<($_-1) & $auto_answer)  } @to_set;
@to_unset=grep {1<<($_-1) & $auto_answer} @to_unset;

exit 0
  if( !@to_unset && !@to_set  );

print "Enabling auto-answer for line(s): ".(reduce {$a.", ".$b} @to_set)."\n"
  if(@to_set);
print "Disabling auto-answer for line(s): ".(reduce {$a.", ".$b} @to_unset)."\n"
  if(@to_unset);

$t->print("test open");

sub wait_then_press
{
        foreach my $key (@_)
        {
                $t->waitfor('/'.PROMPT.'>.*$/');
                $t->print("test ".$key);
        }
}

sub toggle_line
{
        my($line)=@_;
        wait_then_press("offhook", "onhook", "key set", "key 6", "key 8", "key ".$line, "key soft1", "key soft2", "key soft2", "key set");
}

foreach my $line (@to_unset, @to_set)
{
        print "Toggling line: $line\n";
        toggle_line($line);
}

$t->waitfor('/'.PROMPT.'>.*$/');
$t->print("test close");

$t->waitfor('/'.PROMPT.'>.*$/');
$t->print("exit");

print "Success.\n";
```

(Canada) #5

Still having issues where the phone rings twice and then hangs up, I’d greatly appreciate any help.


(Canada) #6

Followed your config Docs posted in the other link.
Phones still ring twice then go busy.


(Dave Burgess) #7

Double check your codec being used.

I remember something about this from a couple years ago but I don’t have any recollection of the solution. Have you tried pinging Dietrich in the Chan-SCCP-B Forum?


(Canada) #8

Using ulaw.
Would the fourms be the sourceforge discussion? Or did I miss the link posted somewhere on github.


(Dave Burgess) #9

There should be a forum on GitHub. I get emails from it once in a while - let me look and see what I can find.


(Canada) #10

Hello, I’m still having issues with getting the phones to answer, and can only find a gitter chat on the github, if you have anymore advice I’d greatly appreciate it if not I’ll continue to play around.

Thanks


(Dave Burgess) #11

The module uses /var/log/asterisk/full for all of the messages, so that might help.

I have a 7970 that I’m having the same problem with. I suppose I can take a look at it. Having said that, though, your problem might be different than mine.