(gelöst, teilw. offToptic) Asterisk restart per easychron

Status
Für weitere Antworten geschlossen.
HeHeHe, Mensch; ungeahnte Möglichkeiten! Kann das Asterisk dann auch noch ein Bier bringen?;-) Das wärs dann noch; oder wenigstens nach Feierabend die Pantoffeln... Ich glaube fast, Du hast dafür auch noch ein Macro im Hemdsärmel! ;-)

Ich versuch das Ganze jetzt einzuarbeiten, wenns klappt, und da bin ich mir ziemlich sicher, gibts Applaus! Applaus! Applaus! FREIBIIIEEER!!!

Viele Grüße
Günter
 
So auf Anhieb gehts dann doch nicht:

May 7 20:18:49 ERROR[21339]: chan_iax2.c:7547 load_module: Unable to bind to 0.0.0.0 port 4569: Address already in use
May 7 20:18:49 WARNING[21339]: loader.c:345 ast_load_resource: chan_iax2.so: load_module failed, returning -1
== Manager unregistered action IAXpeers
== Unregistered channel type 'IAX2'
May 7 20:18:49 WARNING[21339]: loader.c:440 load_modules: Loading module chan_iax2.so failed!
fli4l 2.1.9 #
 
ploieel schrieb:
So auf Anhieb gehts dann doch nicht:

May 7 20:18:49 ERROR[21339]: chan_iax2.c:7547 load_module: Unable to bind to 0.0.0.0 port 4569: Address already in use
May 7 20:18:49 WARNING[21339]: loader.c:345 ast_load_resource: chan_iax2.so: load_module failed, returning -1
== Manager unregistered action IAXpeers
== Unregistered channel type 'IAX2'
May 7 20:18:49 WARNING[21339]: loader.c:440 load_modules: Loading module chan_iax2.so failed!
fli4l 2.1.9 #

Hallo Günter,

hast du einen 'asterisk -rx "restart now"' versucht?
Sind überhaupt IAX2-Verbindungen (iax.conf) definiert?

Kann es sein, dass dir die Meldung vorher nie aufgefallen ist?
Ich denke das macro funktioniert normal nur * scheint nicht sauber zu terminieren und neu zu starten.
In diesem Fall sollte sich der Fehler auch direkt an der Konsole reproduzieren lassen!
 
Ja, habe genau diesen Befehhl zum restart eingegeben...
Dann habe ich aus der Extensions.conf Das godie rausgelöscht, trotzdem sind die Fehler weiter vorhanden.

die iax.conf hat im Original einen Haufen Kommentare, ich schreib sie trotzdem mal schon hierhin und bitte jetzt schon um Entschuldigung.

Code:
[general]
register => xxxxxxxx:[email protected]

, don't use it...
disallow=lpc10			; Icky sound quality...  Mr. Roboto.
;allow=gsm			; Always allow GSM, it's cool :)
;

; You can adjust several parameters relating to the jitter buffer.
;
jitterbuffer=no
;dropcount=2
;maxjitterbuffer=500
;maxexcessbuffer=80
;minexcessbuffer=10
;jittershrinkrate=1

;trunkfreq=20			; How frequently to send trunk msgs (in ms)
;
;register => marko:[email protected]
;
; Register joe at remote host with no password
;
;register => joe@remotehost:5656
;
; Register marko at tormenta.linux-support.net using RSA key "torkey"
;
;register => marko:[torkey]@tormenta.linux-support.net
;
; Sample Registration for iaxtel
;
; Visit http://www.iaxtel.com to register with iaxtel.  Replace "user"
; and "pass" with your username and password for iaxtel.  Incoming 
; calls arrive at the "s" extension of "default" context.
;
;register => user:[email protected]
;
; Sample Registration for IAX + FWD
;
; To register using IAX with FWD, it must be enabled by visiting the URL
; http://www.fwdnet.net/index.php?section_id=112
;
; Note that you need an extension in you default context which matches
; your free world dialup number.  Please replace "FWDNumber" with your
; FWD number and "passwd" with your password.
;
;register => FWDNumber:[email protected]
;
;
; You can disable authentication debugging to reduce the amount of 
; debugging traffic.
;
;authdebug=no
;
; Finally, you can set values for your TOS bits to help improve 
; performance.  Valid values are:
;   lowdelay		-- Minimize delay
;   throughput		-- Maximize throughput
;   reliability		-- Maximize reliability
;   mincost		-- Minimize cost
;   none		-- No flags
;
tos=lowdelay
;
; If mailboxdetail is set to "yes", the user receives
; the actual new/old message counts, not just a yes/no
; as to whether they have messages.  this can be set on
; a per-peer basis as well
;
;mailboxdetail=yes
;
; Guest sections for unauthenticated connection attempts.  Just
; specify an empty secret, or provide no secret section.
;
[guest]
type=user
context=from-iaxport
callerid="Guest IAX User"

;
; Trust Caller*ID Coming from iaxtel.com
;
[iaxtel]
type=user
context=from-iaxport
auth=rsa
inkeys=iaxtel

;
; Trust Caller*ID Coming from iax.fwdnet.net
;
[iaxfwd]
type=user
context=from-iaxport
auth=rsa
inkeys=freeworlddialup

;
; Further user sections may be added, specifying a context and a
; secret used for connections with that given authentication name.
; Limited IP based access control is allowed by use of "allow" and
; "deny" keywords.  Multiple rules are permitted.  Multiple permitted
; contexts may be specified, in which case the first will be the default.
; You can also override caller*ID so that when you receive a call you
; set the Caller*ID to be what you want instead of trusting what
; the remote user provides
;
; There are three authentication methods that are supported:  md5, plaintext,
; and rsa.  The least secure is "plaintext", which sends passwords cleartext
; across the net.  "md5" uses a challenge/response md5 sum arrangement, but
; still requires both ends have plain text access to the secret.  "rsa" allows
; unidirectional secret knowledge through public/private keys.  If "rsa"
; authentication is used, "inkeys" is a list of acceptable public keys on the 
; local system that can be used to authenticate the remote peer, separated by
; the ":" character.  "outkey" is a single, private key to use to authenticate
; to the other side.  Public keys are named /var/lib/asterisk/keys/<name>.pub
; while private keys are named /var/lib/asterisk/keys/<name>.key.  Private
; keys should always be 3DES encrypted.
;
;
;[markster]
;type=user
;context=default
;context=local
;auth=md5,plaintext,rsa
;secret=markpasswd
;notransfer=yes		; Disable IAX native transfer
;callerid="Mark Spencer" <(256) 428-6275>
;deny=0.0.0.0/0.0.0.0
;accountcode=markster0101
;permit=209.16.236.73/255.255.255.0
;language=en		; Use english as default language
;
; Peers may also be specified, with a secret and
; a remote hostname.
;
;[demo]
;type=peer
;username=asterisk
;secret=supersecret
;host=216.207.245.47
;sendani=no
;host=asterisk.linux-support.net
;port=5036
;mask=255.255.255.255
;qualify=yes	; Make sure this peer is alive

;
; Peers can remotely register as well, so that they can be
; mobile.  Default IP's can also optionally be given but
; are not required.  Caller*ID can be suggested to the other
; side as well if it is for example a phone instead of another
; PBX.
;

;[dynamichost]
;host=dynamic
;secret=mysecret
;mailbox=1234		; Notify about mailbox 1234
;inkeys=key1:key2
;peercontext=local	; Default context to request for calls to peer
;defaultip=216.207.245.34
;callerid="Some Host" <(256) 428-6011>
;

;
;[biggateway]
;type=peer
;host=192.168.0.1
;secret=myscret
;trunk=yes		; Use IAX2 trunking with this host
;

;
; Friends are a short cut for creating a user and
; a peer with the same values.
;
;[marko]
;type=friend
;host=dynamic
;secret=moofoo
;context=default
;permit=0.0.0.0/0.0.0.0

[iaxport-outbound]
type=peer
username=xxxxxxxxx
secret=xxxxxxxxx
host=iax.iaxport.de

[iaxport]
type=friend
host=iax.iaxport.de
username=xxxxxxxx
secret=xxxxxxxx
peercontext=iaxport
context=from-iaxport
notransfer=yes
 
Hallo netview;
ich kann im Moment auf das iax-Zeug auch gut verzichten, ich brauche es im Augenblick nicht. Irgendwo in der modules.conf ein noload möglich?

Ja mache ich so. modules.conf:
noload => chan_iax2.so


FÄRTICH!
 
Wenn du einen 'stop now' eingibst und anschliessend mit 'ps -ef' die laufenden Prozesse anschaust, ist da noch asterisk dabei?

Wenn ja killen mit 'kill -9 pid' und asterisk neu starten mit 'asterisk'.
Es könnte vielleicht mit der uclibc zusammenhängen?!
Ich hatte in der Testphase damit auch Probleme, dass asterisk nicht sauber auf commands reagiert hat und nicht terminieren wollte).
Neben der nicht G.729 Unterstützung war dies auch für mich ein k.o.-Kriterium :-(
 
Probier mal in der modules.conf:

noload => chan_iax2.so
 
Code:
fli4l 2.1.9 # asterisk -r
Asterisk 1.0.7-BRIstuffed-0.2.0-RC8, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer <[email protected]>
=========================================================================
Connected to Asterisk 1.0.7-BRIstuffed-0.2.0-RC8 currently running on fli4l (pid = 4516)
fli4l*CLI> stop now
fli4l*CLI>
Disconnected from Asterisk server
fli4l 2.1.9 # ps -ef
  PID  Uid     VmSize Stat Command
    1 root        232 S   init
    2 root            SW  [keventd]
    3 root            SWN [ksoftirqd_CPU0]
    4 root            SW  [kswapd]
    5 root            SW  [bdflush]
    6 root            SW  [kupdated]
  285 root            SW  [kjournald]
 2235 root            SW  [kjournald]
 2569 root        252 S   /usr/sbin/syslogd
 2597 root        212 S   /usr/sbin/klogd -c 1 -x
 2730 root        260 S   /bin/sh /usr/local/bin/service-restart.sh 1 /usr/sbin
 2736 root        260 S   /bin/sh /usr/local/sbin/pppoe-status
 2747 root        444 S   /usr/sbin/pppd call circuit.pppoe eth1
 3389 dns         252 S   /usr/local/dns/dnsmasq
 3431 root        216 S   /usr/local/bin/telmond -port 5001 -log-to-syslog -sys
 3465 root        384 S   /usr/local/bin/imond -log-to-syslog -port 5000 /var/l
 3537 root        264 S   /bin/sh /usr/local/bin/service-restart.sh 0 /usr/sbin
 3547 root        244 S   /usr/sbin/mini_httpd -D -c **.cgi -p 80 -u root
 3570 root       2512 S   /usr/sbin/privoxy --pidfile /var/run/privoxy.pid /etc
 3745 root        448 S   /usr/sbin/nmbd -D
 3752 root        452 S   /usr/sbin/smbd -D
 3843 root        268 S   dropbear -p 22
 3904 root        292 S   capifaxrcvd -i '+49(37600)50462' -l 50462 -n /usr/loc
 4006 root        260 S   /usr/sbin/cron
 4303 root        224 S   /usr/sbin/inetd
 4599 root        180 S   /usr/local/bin/mini-login
 4652 root        468 R   dropbear -p 22
 4679 root        312 S   -sh
 4960 root        164 S   sleep 5
 4961 root        244 R   ps -ef
fli4l 2.1.9 #
Habe jetzt in die modules.conf "noload => chan_iax2.s0" eingetragen, jetzt geht asterisk -vvvvvgc ohne Fehler durch.
 
Und JETZT DEIN godie nochmals rein! Nur nicht aufgeben!!

Nein, leider funktioniert das nicht, schade. Habe gewählt *123# (sollte wohl fli neu starten)

Code:
  == Primary D-Channel on span 1 up for TEI 64
    -- Accepting overlap voice call from '25' to '<unspecified>' on channel 0/2, span 1
    -- Starting simple switch on 'Zap/2-1'
    -- Executing Answer("Zap/2-1", "") in new stack
    -- Executing Wait("Zap/2-1", "30") in new stack
    -- Executing DISA("Zap/2-1", "no-password|dialout_now") in new stack
  == Spawn extension (ausgehend, *123#, 3) exited non-zero on 'Zap/2-1'
    -- Executing Hangup("Zap/2-1", "") in new stack
  == Spawn extension (ausgehend, h, 1) exited non-zero on 'Zap/2-1'
    -- Hungup 'Zap/2-1'
  == Primary D-Channel on span 1 down for TEI 64

Na gut, war wohl doch nichts so schnell mit dem Bier holen...
 
Wenndu mit 'asterisk -r' auf der Konsole bist und per Telefon einen 'restart now' initiierst siehst du es am besten!
 
Nein, leider nicht. Ein bischen warten und dann meldet sich die DISA mit einem neuen Freizeichen...

Code:
  == Primary D-Channel on span 1 up for TEI 64
    -- Starting simple switch on 'Zap/2-1'
    -- Accepting overlap voice call from '25' to '<unspecified>' on channel 0/2, span 1
    -- Executing Answer("Zap/2-1", "") in new stack
    -- Executing Wait("Zap/2-1", "30") in new stack
    -- Executing DISA("Zap/2-1", "no-password|dialout_now") in new stack
    -- Channel 0/2, span 1 got hangup
  == Spawn extension (ausgehend, *456#, 3) exited non-zero on 'Zap/2-1'
    -- Executing Hangup("Zap/2-1", "") in new stack
  == Spawn extension (ausgehend, h, 1) exited non-zero on 'Zap/2-1'
    -- Hungup 'Zap/2-1'
  == Primary D-Channel on span 1 down for TEI 64
 
Steht der macro-Aufruf und auch das macro in der extension [dialout_now]?
* scheint nach [ausgehend] zu verzweigen und findet dort nichts zu *123#!
 
Mal meine gesamte extensions.conf:

Code:
[globals]
IAXINFO=guest
TRUNK=Zap/g1

[general]
static=yes
writeprotect=no

[internal]
exten => 1234,1,Dial(ZAP/g1/1234,20,Tt)
exten => 1234,2,Voicemail2(u1234)
exten => 1234,3,Hangup
exten => 1234,102,Voicemail2(b1234)
exten => 1234,103,Hangup

[external-ISDN_ausgehend]
exten => _X.,1,Answer
exten => _X.,2,Dial(CAPI/25:${EXTEN},,Tt)
exten => _X.,3,Congestion
exten => _X.,4,Hangup

[external-ISDN_eingehend]
exten => 3312,1,Dial(ZAP/g1/25,45,r)
exten => 50459,1,Dial(ZAP/g1/25,45,r)
exten => 50523,1,Dial(ZAP/g1/25,45,r)
exten => 50524,1,Dial(ZAP/g1/25,45,r)

exten => 50530/0162xxxxxxx,1,Wait(1)
exten => 50530/0162xxxxxxx,2,System(cp /etc/asterisk/call/callfile /var/spool/asterisk/outgoing/)
exten => 50530/0162xxxxxxx,3,Wait(1)
exten => 50530/0162xxxxxxx,4,Hangup

[dialout]
; exten => _.,1,ResponseTimeout(90)
exten => _.,1,Answer
exten => _.,2,Wait(30)
exten => _.,3,DISA,no-password|dialout_now
exten => _.,4, Hangup
exten =>_.,102,Busy
exten => h,1,Hangup

; [dialout]
; exten => 666,1,Answer
; exten => 666,2,SetVar(NR=)
; exten => 666,3,ResponseTimeout(60)
; exten => 666,4,WaitExten

; exten => _X,1,SetVar(NR=${NR}${EXTEN})
; exten => _X,2,Goto(666,3)

; exten => *,1,Goto(666,2)

; exten => #,1,Dial(${TRUNK}/${NR},30,H|g)
; exten => #,2,GotoIf($[${DIALSTATUS} = NOANSWER]?4)
; exten => #,3,GotoIf($[${DIALSTATUS} = CONGESTION]?4:5)
; exten => #,4,Playback(vm-nobodyavail)
; exten => #,5,Goto(666,2)
; exten => #,102,Playback(tt-allbusy)

; exten => t,1,Playback(vm-goodbye)
; exten => t,2,HangUp 
  
[dialout_now]
; exten => _.,1,ResponseTimeout,90
; exten => _.,1,SetCallerID(50530)
exten => _.,1,SetCallerID(50534)
; exten => _.,2,Dial(Capi/25:${EXTEN},,Tt)
exten => _.,2,Dial(SIP/${EXTEN}@gmx,60,tr)
; exten => _.,4,Wait(80)
exten => _.,3,Congestion

[external-BLUESIP_ausgehend]
exten => _*8.,1,Dial(SIP/${EXTEN:2}@bluesip,60,tTr)
exten => _*8.,2,Playback(invalid)
exten => _*8.,3,Congestion
exten => _*8.,4,Busy
exten => _*8.,5,Hangup

[external-BLUESIP_eingehend]
exten => xxxxxxxx,1,Dial(ZAP/g1/25,45,r)

[external-SIPGATE_ausgehend]
exten => _*9.,1,Dial(SIP/${EXTEN:2}@sipgate,60,tTr)
exten => _*9.,2,Playback(invalid)
exten => _*9.,3,Congestion
exten => _*9.,4,Busy
exten => _*9.,5,Hangup

[external-SIPGATE_eingehend]
exten => xxxxxxx,1,Dial(ZAP/g1/25,45,r)

[external-GMX_ausgehend]
exten => _*7.,1,Dial(SIP/${EXTEN:2}@gmx,60,tTgH)
exten => _*7.,2,Playback(invalid)
exten => _*7.,3,Congestion
exten => _*7.,4,Busy
exten => _*7.,5,Hangup

[external-GMX_eingehend]
exten => xxxxxxxx,1,Dial(ZAP/g1/25,45,r)

[external-portunity_ausgehend]
exten => _0XXXXXX.,1,Dial(IAX2/iaxport-outbound/${EXTEN})
exten => _*6.,1,Dial(SIP/${EXTEN:2}@sip.sipport,60,tTr)
exten => _*6.,2,Playback(invalid)
exten => _*6.,3,Congestion
exten => _*6.,4,Busy
exten => _*6.,5,Hangup

[from-iaxport]
exten => s,1,Dial(ZAP/g1/25,45,r)

[vmailbox]
exten => 8000,1,VoicemailMain

[Konferenzraum]
exten => 25,1,setLanguage(de)
exten => 25,2,Answer
exten => 25,3,Wait(1)
exten => 25,4,MeetMe,88
exten => 25,5,Hangup

[ausgehend]
include => external-ISDN_ausgehend
include => external-BLUESIP_ausgehend
include => external-SIPGATE_ausgehend
include => external-GMX_ausgehend
include => dialout
include => dialout_now
include => external-portunity_ausgehend

[default]
include => vmailbox
include => internal
include => external-ISDN_eingehend
include => external-BLUESIP_eingehend
include => external-SIPGATE_eingehend
include => external-GMX_eingehend
include => from-iaxport
include => Konferenzraum

;------------------------------------------------ 
; fli4l restart 
;------------------------------------------------ 
exten => *123#,1,Macro(cmd,reboot) 
;------------------------------------------------ 
; asterisk restart 
;------------------------------------------------ 
exten => *456#,1,Macro(cmd,asterisk -rx "restart now") 
;------------------------------------------------ 
; asterisk reload 
;------------------------------------------------ 
exten => *789#,1,Macro(cmd,asterisk -rx "reload") 
;------------------------------------------------- 

[macro-cmd] 

exten => s,1,Answer 
exten => s,2,Wait(1) 
exten => s,3,Playback(de-dankeschön) 
exten => s,4,Wait(1) 
exten => s,5,System(${ARG1}) 
exten => s,6,Hangup 
exten => s,102,Busy

wobei ich auch eigentlich auf internal und voicemailbox verzichten könnte...
 
Also unter default wird die Sache nicht gefunden.

1) Kopiere das Ganze nach [dialout_now]!

Problem ist - du hast dort _. stehen und dies zieht sofort, da * dies an den Anfang sortiert (Reihenfolge wie du es geschrieben hast wird von asterisk nicht so geladen!)
Besser wäre wenn du _. ersetzt durch _XXXXX. (Anzahl der X gleich Länge von *123# also 5!)
 
Sieht jetzt so aus, ist aber unverändert:
Code:
[dialout_now]
; exten => _.,1,ResponseTimeout,90
; exten => _.,1,SetCallerID(50530)
exten => _XXXXX.,1,SetCallerID(50534)
; exten => _.,2,Dial(Capi/25:${EXTEN},,Tt)
exten => _XXXXX.,2,Dial(SIP/${EXTEN}@gmx,60,tr)
; exten => _.,4,Wait(80)
exten => _XXXXX.,3,Congestion
;------------------------------------------------ 
; fli4l restart 
;------------------------------------------------ 
exten => *123#,1,Macro(cmd,reboot) 
;------------------------------------------------ 
; asterisk restart 
;------------------------------------------------ 
exten => *456#,1,Macro(cmd,asterisk -rx "restart now") 
;------------------------------------------------ 
; asterisk reload 
;------------------------------------------------ 
exten => *789#,1,Macro(cmd,asterisk -rx "reload") 
;------------------------------------------------- 

[macro-cmd] 
exten => s,1,Answer 
exten => s,2,Wait(1) 
exten => s,3,Playback(de-dankeschön) 
exten => s,4,Wait(1) 
exten => s,5,System(${ARG1}) 
exten => s,6,Hangup 
exten => s,102,Busy
 
Kann es sein, dass disa * und # schluckt?
Was passiert denn wenn du 99999 statt *123# setzt?
 
Muss ich das [macro-cmd] irgendwo includieren?

Nein, geht auch nicht.
Mit dem SAMBA kann man ja am Asterisk ganz schön rumtesten... geht schnell und unkompliziert, gute Sache!
 
Bei 99999 passiert folgendes:
Code:
*CLI>   == Primary D-Channel on span 1 up for TEI 64
    -- Starting simple switch on 'Zap/2-1'
    -- Accepting overlap voice call from '25' to '<unspecified>' on channel 0/2, span 1
    -- Executing Answer("Zap/2-1", "") in new stack
    -- Executing Dial("Zap/2-1", "CAPI/25:99999||Tt") in new stack
    -- creating pipe for PLCI=-1
    -- Called 25:99999
    -- CAPI[contr1/25]/0 is making progress passing it to Zap/2-1
    -- CAPI Hangingup
    -- removed pipe for PLCI = 0x101
  == No one is available to answer at this time
    -- Executing Congestion("Zap/2-1", "") in new stack
    -- Channel 0/2, span 1 got hangup
  == Spawn extension (ausgehend, 99999, 3) exited non-zero on 'Zap/2-1'
    -- Executing Hangup("Zap/2-1", "") in new stack
  == Spawn extension (ausgehend, h, 1) exited non-zero on 'Zap/2-1'
    -- Hungup 'Zap/2-1'
nach ein paar Sekunden kommt besetzt.
 
Ich verstehe im Moment nicht ganz warum es nicht zieht - nachfolgendes Beispiel sollte auf alle Fälle gehen:

[dialout_now]

exten => _.,1,GotoIf($[${EXTEN:0:5} = *456#]?2:3)
;------------------------------------------------
; asterisk restart
;------------------------------------------------
exten => _.,2,Macro(cmd,asterisk -rx "restart now")
;------------------------------------------------
exten => _.,3,SetCallerID(50530)
exten => _.,4,Dial(Capi/25:${EXTEN},,Tt)
exten => _.,5,Congestion
exten => _.,6,Hangup
 
Status
Für weitere Antworten geschlossen.
Kostenlos!

Statistik des Forums

Themen
248,901
Beiträge
2,304,561
Mitglieder
378,604
Neuestes Mitglied
Duggy