Starting asterisk

Hi,
I sent message about apdating modules. I things the problem is asterisk which is not started. I don’t know why it don’t do. when I make amportal restart in a CLI FOP starts correctly but I get the following message about asterisk " /usr/sbin/safe_asterisk: 187: Syntax error: Bad fd number ".
If someone could help me please.
Warmly thanks

You need post info on your setup
What linux distro you are using and so on.
/usr/sbin/safe_asterisk: 187: Syntax error: Bad fd number
is telling you that line 187 has something your setup does like or maybe it is a error in the file header.

Your other post about can not connect to port 5038 could be you have a firewall on the box which is not allowing traffic fore that port.

Help us Help you by providing us something to work with.

Thanks for your answer tadpole
But I don’t where to make firewall allow the trafic for the port 5038. For the first request, I saw that the line 187 of the file /usr/sbin/safe_asterisk is “fi” and then I don’t know where is th error.
I’m using Ubuntu 8.10 to do it.

what is the first line of the file
/usr/sbin/safe_asterisk

and a quick heads up by using Ubuntu you have made it harder for yourself.

Centos is the way to go until you get the process down.

Hi,
Thanks Bubba. The following five lines are the beginning of the file 

/usr/sbin/safe_asterisk.

#!/bin/sh

vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent

if [ -f /etc/default/asterisk ]; then
. /etc/default/asterisk;
fi

Personaly, hitherto I don’t realy understand the problem. May could I try to resolv it if I knew. Because Ubuntu is base on Debian, I though there would not problem.

Debian can be use yes, BUT as MOST of the work done with Freepbx / asterisk on our level is done based on Centos so you must adjust the install
Try this
change the first line in /usr/sbin/safe_asterisk from #!/bin/sh to #!/bin/bash

I already did it and then I don’t get this message again but get another message
Asterisk ended with exit status 1
Asterisk died with code 1.
Automatically restarting Asterisk.
Continiously this message came until I stop it with ctrl+c.
May be I must try it with centos finaly. But I realy hope to do it with ubuntu.

You are geting closer
stop asterisk_safe from running
and start with this
asterisk -vvvvvvvvgc
you should be able to watch the output and see what chokes
You can look for it to be a path or permission thing

I did it (asterisk -vvvvvvvvgc) but there is neither error reported. Now I’m asking myself if it is a dependency error. Also I am using asterisk 1.4.22.2 and I wante to try with asterisk 1.4.23.1. But I still hope to solve this problem.

You say no error, so you are saying Asterisk started???

Asterisk still not running.
That is the result of the command asterisk -vvvvvvvvgc

Asterisk 1.4.22.2, Copyright © 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

== Parsing ‘/etc/asterisk/asterisk.conf’: Found
== Parsing ‘/etc/asterisk/extconfig.conf’: Found
== Parsing ‘/etc/asterisk/logger.conf’: Found
Asterisk Event Logger Started /var/log/asterisk/event_log
Asterisk Dynamic Loader Starting:
== Parsing ‘/etc/asterisk/modules.conf’: Found
== Parsing ‘/etc/asterisk/dnsmgr.conf’: Found
== Parsing ‘/etc/asterisk/http.conf’: Found
== Manager registered action Ping
== Manager registered action Events
== Manager registered action Logoff
== Manager registered action Hangup
== Manager registered action Status
== Manager registered action Setvar
== Manager registered action Getvar
== Manager registered action GetConfig
== Manager registered action UpdateConfig
== Manager registered action Redirect
== Manager registered action Originate
== Manager registered action Command
== Manager registered action ExtensionState
== Manager registered action AbsoluteTimeout
== Manager registered action MailboxStatus
== Manager registered action MailboxCount
== Manager registered action ListCommands
== Manager registered action UserEvent
== Manager registered action WaitEvent
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Parsing ‘/etc/asterisk/users.conf’: Found
Asterisk Management interface listening on port 5038
== Parsing ‘/etc/asterisk/cdr.conf’: Found
== Parsing ‘/etc/asterisk/rtp.conf’: Found
== RTP Allocating from port range 10000 -> 20000
== Parsing ‘/etc/asterisk/udptl.conf’: Found
== UDPTL allocating from port range 4000 -> 4999
Asterisk PBX Core Initializing
Registering builtin applications:
[Answer]
== Registered application ‘Answer’
[BackGround]
== Registered application ‘BackGround’
[Busy]
== Registered application ‘Busy’
[Congestion]
== Registered application ‘Congestion’
[Goto]
== Registered application ‘Goto’
[GotoIf]
== Registered application ‘GotoIf’
[GotoIfTime]
== Registered application ‘GotoIfTime’
[ExecIfTime]
== Registered application ‘ExecIfTime’
[Hangup]
== Registered application ‘Hangup’
[NoOp]
== Registered application ‘NoOp’
[Progress]
== Registered application ‘Progress’
[ResetCDR]
== Registered application ‘ResetCDR’
[Ringing]
== Registered application ‘Ringing’
[SayNumber]
== Registered application ‘SayNumber’
[SayDigits]
== Registered application ‘SayDigits’
[SayAlpha]
== Registered application ‘SayAlpha’
[SayPhonetic]
== Registered application ‘SayPhonetic’
[SetAMAFlags]
== Registered application ‘SetAMAFlags’
[SetGlobalVar]
== Registered application ‘SetGlobalVar’
[Set]
== Registered application ‘Set’
[ImportVar]
== Registered application ‘ImportVar’
[Wait]
== Registered application ‘Wait’
[WaitExten]
== Registered application ‘WaitExten’
== Manager registered action DBGet
== Manager registered action DBPut
== Parsing ‘/etc/asterisk/enum.conf’: Found
Asterisk Dynamic Loader Starting:
== Parsing ‘/etc/asterisk/modules.conf’: Found
== Registered application ‘MusicOnHold’
== Registered application ‘WaitMusicOnHold’
== Registered application ‘SetMusicOnHold’
== Registered application ‘StartMusicOnHold’
== Registered application ‘StopMusicOnHold’
== Parsing ‘/etc/asterisk/musiconhold.conf’: Found
== Parsing ‘/etc/asterisk/musiconhold_custom.conf’: Found
== Parsing ‘/etc/asterisk/musiconhold_additional.conf’: Found
res_musiconhold.so => (Music On Hold Resource)
== Parsing ‘/etc/asterisk/jabber.conf’: Found
== Manager registered action JabberSend
== Registered application ‘JabberSend’
== Registered application 'JabberStatus’
res_jabber.so => (AJI - Asterisk Jabber Interface)
res_config_odbc loaded.
res_config_odbc.so => (ODBC Configuration)
== Parsing ‘/etc/asterisk/res_odbc.conf’: Found
res_odbc.so => (ODBC Resource)
== Parsing ‘/etc/asterisk/res_snmp.conf’: Found
Loading [Sub]Agent Module
res_snmp.so => (SNMP [Sub]Agent for Asterisk)
== Parsing ‘/etc/asterisk/esel.conf’: Found
res_esel.so => (Extension State Export Logic (E.S.E.L.) Resource)
== Registered application ‘DeadAGI’
== Registered application ‘EAGI’
== Registered application 'AGI’
res_agi.so => (Asterisk Gateway Interface (AGI))
res_speech.so => (Generic Speech Recognition API)
== Parsing ‘/etc/asterisk/adsi.conf’: Found
res_adsi.so => (ADSI Resource)
– Loaded PUBLIC key ‘iaxtel’
– Loaded PUBLIC key 'freeworlddialup’
res_crypto.so => (Cryptographic Digital Signatures)
== Registered custom function SMDI_MSG_RETRIEVE
== Registered custom function SMDI_MSG
== Parsing ‘/etc/asterisk/smdi.conf’: Found
== Parsing ‘/etc/asterisk/watchdog.conf’: Found
res_watchdog.so => (Watchdog Resource)
== Parsing ‘/etc/asterisk/indications.conf’: Found
– Registered indication country ‘at’
– Registered indication country ‘au’
– Registered indication country ‘bg’
– Registered indication country ‘br’
– Registered indication country ‘be’
– Registered indication country ‘ch’
– Registered indication country ‘cl’
– Registered indication country ‘cn’
– Registered indication country ‘cz’
– Registered indication country ‘de’
– Registered indication country ‘dk’
– Registered indication country ‘ee’
– Registered indication country ‘es’
– Registered indication country ‘fi’
– Registered indication country ‘fr’
– Registered indication country ‘gr’
– Registered indication country ‘hu’
– Registered indication country ‘il’
– Registered indication country ‘in’
– Registered indication country ‘it’
– Registered indication country ‘lt’
– Registered indication country ‘jp’
– Registered indication country ‘mx’
– Registered indication country ‘my’
– Registered indication country ‘nl’
– Registered indication country ‘no’
– Registered indication country ‘nz’
– Registered indication country ‘pl’
– Registered indication country ‘pt’
– Registered indication country ‘ru’
– Registered indication country ‘se’
– Registered indication country ‘sg’
– Registered indication country ‘th’
– Registered indication country ‘uk’
– Registered indication country ‘us’
– Registered indication country ‘us-o’
– Registered indication country ‘tw’
– Registered indication country ‘ve’
– Registered indication country ‘za’
– Setting default indication country to ‘us’
== Registered application ‘PlayTones’
== Registered application 'StopPlayTones’
res_indications.so => (Indications Resource)
== Registered application ‘StealChan’
== Registered application ‘PickupChan’
== Registered application ‘PickDown’
== Registered application ‘Steal’
== Registered application 'PickUp’
app_pickup.so => (PickUp/PickDown/Steal/PickupChan/StealChan)
== Parsing ‘/etc/asterisk/res_pgsql.conf’: Found
Postgresql RealTime driver loaded.
res_config_pgsql.so => (PostgreSQL RealTime Configuration Driver)
== Registered application ‘Monitor’
== Registered application ‘StopMonitor’
== Registered application ‘ChangeMonitor’
== Registered application ‘PauseMonitor’
== Registered application ‘UnpauseMonitor’
== Manager registered action Monitor
== Manager registered action StopMonitor
== Manager registered action ChangeMonitor
== Manager registered action PauseMonitor
== Manager registered action UnpauseMonitor
res_monitor.so => (Call Monitoring Resource)
== Registered application 'Segfault’
app_segfault.so => (Application for crashing Asterisk with a segmentation fault)
== Registered file format wav, extension(s) wav
format_wav.so => (Microsoft WAV format (8000Hz Signed Linear))
== Registered file format pcm, extension(s) pcm|ulaw|ul|mu
== Registered file format alaw, extension(s) alaw|al
== Registered file format au, extension(s) au
== Registered file format g722, extension(s) g722
format_pcm.so => (Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU), G.722 16Khz)
== Registered file format mp3, extension(s) mp3
format_mp3.so => (MP3 format [Any rate but 8000hz mono is optimal])
== Registered application 'DumpChan’
app_dumpchan.so => (Dump Info About The Calling Channel)
== Registered application 'Read’
app_read.so => (Read Variable Application)
== Registered application 'Morsecode’
app_morsecode.so => (Morse code)
== Registered application 'Record’
app_record.so => (Trivial Record Application)
== Registered application 'UserEvent’
app_userevent.so => (Custom User Event Application)
== Registered application ‘SetCDRUserField’
== Registered application ‘AppendCDRUserField’
== Manager registered action SetCDRUserField
app_setcdruserfield.so => (CDR user field apps)
== Registered application 'Directory’
app_directory.so => (Extension Directory)
== Registered application 'LookupCIDName’
app_lookupcidname.so => (Look up CallerID Name from local database)
== Parsing ‘/etc/asterisk/meetme.conf’: Found
== Parsing ‘/etc/asterisk/meetme_additional.conf’: Found
== Parsing ‘/etc/asterisk/sla.conf’: Found
== Manager registered action MeetmeMute
== Manager registered action MeetmeUnmute
== Registered application ‘MeetMeAdmin’
== Registered application ‘MeetMeCount’
== Registered application ‘MeetMe’
== Registered application ‘SLAStation’
== Registered application 'SLATrunk’
app_meetme.so => (MeetMe conference bridge)
== Registered custom function AUDIOHOOK_INHERIT
func_audiohookinherit.so => (Audiohook inheritance function)
== Parsing ‘/etc/asterisk/queues.conf’: Found
== Parsing ‘/etc/asterisk/queues_general_additional.conf’: Found
== Parsing ‘/etc/asterisk/queues_custom_general.conf’: Found
== Parsing ‘/etc/asterisk/queues_custom.conf’: Found
== Parsing ‘/etc/asterisk/queues_additional.conf’: Found
== Parsing ‘/etc/asterisk/queues_post_custom.conf’: Found
== Registered application ‘Queue’
== Registered application ‘AddQueueMember’
== Registered application ‘RemoveQueueMember’
== Registered application ‘PauseQueueMember’
== Registered application ‘UnpauseQueueMember’
== Registered application ‘QueueLog’
== Manager registered action Queues
== Manager registered action QueueStatus
== Manager registered action QueueAdd
== Manager registered action QueueRemove
== Manager registered action QueuePause
== Registered custom function QUEUEAGENTCOUNT
== Registered custom function QUEUE_MEMBER_COUNT
== Registered custom function QUEUE_MEMBER_LIST
== Registered custom function QUEUE_WAITING_COUNT
app_queue.so => (True Call Queueing)
== Parsing ‘/etc/asterisk/codecs.conf’: Found
– codec_g726: using generic PLC
== Registered translator ‘g726tolin’ from format g726 to slin, cost 1
== Registered translator ‘lintog726’ from format slin to g726, cost 1
== Registered translator ‘g726aal2tolin’ from format g726aal2 to slin, cost 1
== Registered translator ‘lintog726aal2’ from format slin to g726aal2, cost 1
== Registered translator ‘g726aal2tog726’ from format g726aal2 to g726, cost 1
== Registered translator ‘g726tog726aal2’ from format g726 to g726aal2, cost 1
codec_g726.so => (ITU G.726-32kbps G726 Transcoder)
== Registered custom function FIELDQTY
== Registered custom function FILTER
== Registered custom function REGEX
== Registered custom function ARRAY
== Registered custom function QUOTE
== Registered custom function LEN
== Registered custom function STRFTIME
== Registered custom function STRPTIME
== Registered custom function EVAL
== Registered custom function KEYPADHASH
== Registered custom function SPRINTF
func_strings.so => (String handling dialplan functions)
== Registered file format g729, extension(s) g729
format_g729.so => (Raw G729 data)
== Registered application 'ParkAndAnnounce’
app_parkandannounce.so => (Call Parking and Announce Application)
res_clioriginate.so => (Call origination from the CLI)
== Parsing ‘/etc/asterisk/cdr_odbc.conf’: Found
cdr_odbc.so => (ODBC CDR Backend)
== Registered application 'DISA’
app_disa.so => (DISA (Direct Inward System Access) Application)
== Parsing ‘/etc/asterisk/followme.conf’: Found
== Registered application 'FollowMe’
app_followme.so => (Find-Me/Follow-Me Application)
== Parsing ‘/etc/asterisk/alarmreceiver.conf’: Found
== Registered application 'AlarmReceiver’
app_alarmreceiver.so => (Alarm Receiver for Asterisk)
== Registered application 'Zapateller’
app_zapateller.so => (Block Telemarketers with Special Information Tone)
== Registered application 'BackgroundDetect’
app_talkdetect.so => (Playback with Talk Detection)
== Registered application ‘Log’
== Registered application 'Verbose’
app_verbose.so => (Send verbose output)
== Registered application 'WaitForSilence’
app_waitforsilence.so => (Wait For Silence)
== Registered channel type ‘DS’ (Application for sending device state messages)
== Manager registered action Devstate
== Registered application 'Devstate’
app_devstate.so => (Simple Devstate Application)
== Registered file format iLBC, extension(s) ilbc
format_ilbc.so => (Raw iLBC data)
== Parsing ‘/etc/asterisk/codecs.conf’: Found
– codec_lpc10: using generic PLC
== Registered translator ‘lpc10tolin’ from format lpc10 to slin, cost 1
== Registered translator ‘lintolpc10’ from format slin to lpc10, cost 2
codec_lpc10.so => (LPC10 2.4kbps Coder/Decoder)
== Registered file format g723sf, extension(s) g723|g723sf
format_g723.so => (G.723.1 Simple Timestamp File Format)
== Registered application 'SayCountPL’
app_saycountpl.so => (Say polish counting words)
== Registered application ‘SpeechCreate’
== Registered application ‘SpeechLoadGrammar’
== Registered application ‘SpeechUnloadGrammar’
== Registered application ‘SpeechActivateGrammar’
== Registered application ‘SpeechDeactivateGrammar’
== Registered application ‘SpeechStart’
== Registered application ‘SpeechBackground’
== Registered application ‘SpeechDestroy’
== Registered application ‘SpeechProcessingSound’
== Registered custom function SPEECH
== Registered custom function SPEECH_SCORE
== Registered custom function SPEECH_TEXT
== Registered custom function SPEECH_GRAMMAR
== Registered custom function SPEECH_ENGINE
== Registered custom function SPEECH_RESULTS_TYPE
app_speech_utils.so => (Dialplan Speech Applications)
== Registered translator ‘alawtoulaw’ from format alaw to ulaw, cost 1
== Registered translator ‘ulawtoalaw’ from format ulaw to alaw, cost 1
codec_a_mu.so => (A-law and Mulaw direct Coder/Decoder)
== Registered custom function BASE64_ENCODE
== Registered custom function BASE64_DECODE
func_base64.so => (base64 encode/decode dialplan functions)
== Registered application 'Milliwatt’
app_milliwatt.so => (Digital Milliwatt (mu-law) Test Application)
== Registered application 'ZapBarge’
app_dahdibarge.so => (Barge in on channel application)
== Parsing ‘/etc/asterisk/codecs.conf’: Found
– CODEC SPEEX: Setting Quality to 3
– CODEC SPEEX: Setting Complexity to 2
– CODEC SPEEX: Perceptual Enhancement Mode. [on]
– CODEC SPEEX: VAD Mode. [on]
– CODEC SPEEX: VBR Mode. [on]
– CODEC SPEEX: Disabling ABR
– CODEC SPEEX: Setting VBR Quality to 4.000000
– CODEC SPEEX: DTX Mode. [off]
– CODEC SPEEX: Preprocessing. [off]
– CODEC SPEEX: Preprocessor VAD. [off]
– CODEC SPEEX: Preprocessor AGC. [off]
– CODEC SPEEX: Setting preprocessor AGC Level to 8000.000000
– CODEC SPEEX: Preprocessor Denoise. [off]
– CODEC SPEEX: Preprocessor Dereverb. [off]
– CODEC SPEEX: Setting preprocessor Dereverb Decay to 0.400000
– CODEC SPEEX: Setting preprocessor Dereverb Level to 0.300000
== Registered translator ‘speextolin’ from format speex to slin, cost 1
== Registered translator ‘lintospeex’ from format slin to speex, cost 7
codec_speex.so => (Speex Coder/Decoder)
== Registered file format vox, extension(s) vox
format_vox.so => (Dialogic VOX (ADPCM) File Format)
== Registered application ‘VoiceMail’
== Registered application ‘VoiceMailMain’
== Registered application ‘MailboxExists’
== Registered application ‘VMAuthenticate’
== Parsing ‘/etc/asterisk/voicemail.conf’: Found
== Parsing ‘/etc/asterisk/users.conf’: Found
app_voicemail.so => (Comedian Mail (Voicemail System))
== Registered channel type ‘Local’ (Local Proxy Channel Driver)
chan_local.so => (Local Proxy Channel (Note: used internally by other modules))
== Registered application ‘RealTimeUpdate’
== Registered application 'RealTime’
app_realtime.so => (Realtime Data Lookup/Rewrite)
cdr_sqlite.so => (SQLite CDR Backend)
== Registered application 'SendImage’
app_image.so => (Image Transmission Application)
== Registered format ‘jpg’ (JPEG (Joint Picture Experts Group))
format_jpeg.so => (JPEG (Joint Picture Experts Group) Image Format)
pbx_spool.so => (Outgoing Spool Support)
== Registered application 'MP3Player’
app_mp3.so => (Silly MP3 Application)
== Registered application ‘ZapScan’
== Registered application 'DAHDIScan’
app_dahdiscan.so => (Scan Zap channels application)
== Registered application 'ICES’
app_ices.so => (Encode and Stream via icecast and ices)
== Registered application 'Dictate’
app_dictate.so => (Virtual Dictation Machine)

and I don’t know where is the problem.

easy fix in case someone else runs into this problem:

Change The Default Shell

/bin/sh is a symlink to /bin/dash, however we need /bin/bash, not /bin/dash.

Therefore we do this:
dpkg-reconfigure dash

When prompted:
Install dash as /bin/sh? ← No

source:
falko

pmoore4321,

Thanks for posting that info. I like your sig posting the config info. It’s a nice way to provide the info without having to type it all the time.

If it is accurate you might want to consider updating FreeePBX as many many bugs have been fixed since the release of rc3.