Ring to all on second line?

Hi all,

I am putting together a new system on FreePBX 12.0.41 w/Asterisk 11.15.

I have ~20 SPA504G phones. I had originally intended to transfer calls to ring groups as the calls came in. Now my boss is wanting everyone to be able to answer the phone when/if it rings, but have it mainly go to one person. Keep in mind that we’re coming from an old analog system where everyone could see all (6) lines and when they were ringing, etc. They did not ring unless our extension specifically was dialed, but we could answer any line if there was a call coming in. The idea was that the main ‘operator’ would have her phone ring, but anyone else in the office could pick up the slack if necessary.

He is wanting something similar to this - where everyone can see incoming calls and answer them if need be. I have no clue how this can be done in FreePBX, or even if it can be done in FreePBX.

If anyone can point me in the right direction here, I would greatly appreciate it.

Start here:

Then look at the user guide link at bottom of page.

Hello You need to understand mysql for this, and know I will edit the files conf put a controller in symfony php doing this manually.

Hi Jyates01
Many times the add sip module does not do what I need directly from my application , record the data

This My Controller call Service Save my conf in /etc/asterisk/externsions_additional.conf

#-------------------------------------------------save extension_additional.conf freepbx



		foreach($headers as $header){

Sorry, but changing anything in :-

will not survive a reload.

in my service layer, mount the array em headers ,‘valor’’=‘value’ ok?
#--------------------------------------array contents

public function arrayExtensions($header,$sip){

$vars=array() ;  
switch ($header) {
case "[ext-cf-hints]":
	    'valor1'=>'exten => *96'.$sip.',1,Goto(a p p-cf-toggle,*96,1)',
	    'valor2'=>'exten => *96'.$sip.',hint,Custom:DEVCF225',
	    'valor4'=>'exten => _*96'.$sip.'.,1,Set(toext=${EXTEN:8})',
	    'valor5'=>'exten => _*96'.$sip.'.,n,Goto(app-cf-toggle,*96,setdirect)',
case "[ext-local]":
	    'valor1'=>'exten => *84'.$sip.',1,Goto(app-campon-toggle,*84,1)',
	    'valor2'=>'exten => *84'.$sip.',hint,ccss:SIP/'.$sip.'',
	    'valor4'=>'exten => '.$sip.',1,Set(__RINGTIMER=${IF($[${DB(AMPUSER/'.$sip.'/ringtimer)} > 0]?${DB($',
	    'valor5'=>'exten => '.$sip.',n,Macro(exten-vm,novm,'.$sip.',0,0,0)',
	    'valor6'=>'exten => '.$sip.',n(dest),Set(__PICKUPMARK=)',
	    'valor7'=>'exten => '.$sip.',n,Goto(${IVR_CONTEXT},return,1)',
	    'valor8'=>'exten => '.$sip.',n,Goto(from-internal,'.$sip.',1)',
	    'valor9'=>'exten => '.$sip.',hint,SIP/'.$sip.'&Custom:DND'.$sip.',CustomPresence:'.$sip.''
case "[ext-dnd-hints]":
	    'valor1'=>'exten => *76'.$sip.',1,Goto(app-dnd-toggle,*76,1)',
	    'valor2'=>'exten => *exten => *76'.$sip.',hint,Custom:DEVDND'.$sip.''
case "[ext-findmefollow]":
	    'valor1'=>'exten => *21'.$sip.',1,Goto(app-fmf-toggle,*21,1)',
	    'valor2'=>'exten => *21'.$sip.',hint,Custom:FOLLOWME'.$sip.''
case "[ext-intercom-users]":
	    'valor1'=>'exten => *80'.$sip.',1,Goto(ext-intercom,${EXTEN},1)'
case "[from-did-direct-ivr]":
	    'valor1'=>'exten => '.$sip.',1,Macro(blkvm-clr,)',
	    'valor2'=>'exten => '.$sip.',n,Set(__NODEST=)',
	    'valor3'=>'exten => '.$sip.',n,Goto(from-did-direct,'.$sip.',1)',
case "[park-hints]":
	    'valor1'=>'exten => *85'.$sip.',1,Macro(parked-call,,default)',
	    'valor2'=>'exten => *85'.$sip.',hint,Custom:PARK'.$sip.''
	exit("Tipos Diferentes extension");

$this->openFile("/etc/asterisk/extensions_additional.conf", $vars,$header);



you must write to mysql in the entities “sip " , “users” , " devices” . And in the files " extensions_additional.conf " and " sip_additional.conf "

this write conf

public function openFile($file,$array,$header){

#open conf and write conf

#open conf
$ftp = fopen($file, "r");

if ($ftp) {
	  #FAZ A leitura do txt  
	  $mydata = fgets($ftp);
	   #procura a ocorrencia
	   $pos=strpos($mydata,$header);//compara o cabecalho pra inserir o valor
	   $char=substr($mydata, 0,1);  //verifica se terminou o bloco com ";" e nao add mais

	   #entra aqui pra nao inserir o bloco no novo arquivo
	  if($pos!==false and $char!==";")
	       foreach ($array as $contents){



	$this->delAll($file);#first del file
	$this->save($file,$new_file);#var new file preenchida salva o novo arquivo
	fclose($ftp);//close connection
	return $new_file;


I know, I have been doing it for years, if you have good stuff and/or improvements to FreePBX (the GUI) then I suggest you propose your solution to the Developers. Posting hacks here that will screw many up if they follow them is almost certainly disruptive.

public function delAll($file){


// The path to the FTP file, including login arguments
//$ftp_path = 'ftp://root:[email protected]'.$file;
    $ftp_path =$file;

// Allows overwriting of existing files on the remote FTP server
$stream_options = array('ftp' => array('overwrite' => true));

// Creates a stream context resource with the defined options
$stream_context = stream_context_create($stream_options);

// Opens the file for writing and truncates it to zero length 
if ($fh = fopen($ftp_path, 'w', 0, $stream_context))
    // Writes contents to the file
    fputs($fh, '');

    $data["message"]="arquivo conf deletado com sucesso!";
    // Closes the file handle
    $data["message"]="arquivo conf nao deletado erro!";
    die('Could not open file.');

return $data;


I needed help and could not 'm just sharing here for those who need it.

hum , ok sorry , only tried to help thanks.

Not a problem, the open source FreePBX is “opensource” and please hack away as I do, but most folks here need a turmkey solution that works, your solution is incomplete and way above most readers comprehension here. Maybe complete and fully document it for peer review, propose it to Sangoma, or offer a third party module to do it.