chan-sccp / PAMI

Fork of PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
http://marcelog.github.com/PAMI
Apache License 2.0
26 stars 21 forks source link

OriginateAction Error #11

Closed varlog11 closed 4 years ago

varlog11 commented 4 years ago

Hello!

I try to make an outgoing call and get an error: [2020-02-25 17:32:20] ERROR[23953][C-00000012]: channel.c:5568 set_format: Unable to set format because channel OutgoingSpoolFailed supports no formats [2020-02-25 17:32:20] ERROR[23953][C-00000012]: channel.c:8041 ast_channel_start_silence_generator: Could not set write format to SLINEAR

My code:

$originateMsg = new OriginateAction("Local/222222@from-internal");
$originateMsg->setActionID('111111');
$originateMsg->setContext('from-internal');
$originateMsg->setPriority('1');
$originateMsg->setExtension('345678');
$originateMsg->setCallerId("Check <345678>");
$originateMsg->setTimeout('40');

$originateMsg->setAsync(true);
$response = $asteriskClient->send($originateMsg);
$orgStatus = $response->getKeys()['response'];

response:

object(PAMI\Message\Response\GenericResponse)#23 (10) {
  ["events":protected]=>
  array(0) {
  }
  ["completed":protected]=>
  bool(true)
  ["rawContent":protected]=>
  string(75) "Response: Success
ActionID: 111111
Message: Originate successfully queued"
  ["channelVariables":protected]=>
  array(1) {
    ["default"]=>
    array(0) {
    }
  }
  ["statusVariables":protected]=>
  array(1) {
    ["default"]=>
    array(0) {
    }
  }
  ["lines":protected]=>
  array(0) {
  }
  ["variables":protected]=>
  array(0) {
  }
  ["keys":protected]=>
  array(3) {
    ["response"]=>
    string(7) "Success"
    ["actionid"]=>
    string(6) "111111"
    ["message"]=>
    string(29) "Originate successfully queued"
  }
  ["createdDate":protected]=>
  int(1582637653)
  ["eventsCount"]=>
  int(0)
}
dkgroot commented 4 years ago

@varlog11 The error your are getting is on the asterisk / channel driver site. As you are using a 'Local' channel it is not fully clear what channel driver. This does not look like a PAMI error at first hand, but maybe a problem in the channel driver use / the channel drivers configuration or your use of the Originate command. Have you tried originating from the commandline CLI (with the same parameters), using using a manual spool file, to see if that causes the same issue ?

varlog11 commented 4 years ago

Yes you're right it's my mistake. $originateMsg->setTimeout('40'); in milliseconds Thanks for the help!