PDA

Επιστροφή στο Forum : Νέοπας σε Asterisk/Elastix



megahead13
07-04-10, 21:56
Νέος στο χώρο του Asterisk/Elastix, οπότε χρειάζομαι κάποια βοήθεια. Έχω εγκαταστήσει Elastix σε 2 servers για κάποιο πρότζεκτ στο πανεπιστήμιο. Στον έναν από αυτούς έχω φτιάξει κάποια extensions μέσω του web interface προκειμένου να τεστάρω αυτό που θέλω να κάνω στη συνέχεια του πρότζεκτ. Ένα από τα extensions όμως το έφτιαξα χεράτα, δημιουργώντας τα δικά μου conf αρχεία, τα οποία φυσικά έκανα include στα κυρίως extensions.conf και sip.conf. Το πρόβλημα είναι ότι όταν καλώ αυτό το extension η κλήση αποτυγχάνει. Παραθέτω τα conf μου:

extensions_mine.conf


[myincoming]
exten => 1100,1,Answer()
exten => 1100,n,Playback(hello-world)
exten => 1100,n,Hangup()

sip.conf


[general]
allow=all
register => 1100:1100@192.168.1.2/1100

sip_mine.conf


[1100]
type=friend
context=myincoming
username=1100
secret=1100
host=192.168.1.2

Καμιά ιδέα για το τι κάνω λάθος; Ευχαριστώ...

........Auto merged post: megahead13 πρόσθεσε 50 λεπτά και 33 δευτερόλεπτα αργότερα ........

Να και το log όταν προσπαθώ να καλέσω το extension που έφτιαξα χεράτα:

[Apr 7 19:45:49] VERBOSE[2886] chan_sip.c: Reloading SIP
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_general_additional.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_mine.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_general_custom.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_nat.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_registrations_custom.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_registrations.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_custom.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_additional.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_custom_post.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/users.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_notify.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_notify_custom.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] config.c: == Parsing '/etc/asterisk/sip_notify_additional.conf': [Apr 7 19:45:49] VERBOSE[2886] config.c: == Found
[Apr 7 19:45:49] VERBOSE[2886] chan_sip.c: -- Registered SIP '1100' at 192.168.1.2 port 5060
[Apr 7 19:47:08] VERBOSE[2886] netsock.c: == Using SIP RTP TOS bits 184
[Apr 7 19:47:08] VERBOSE[2886] netsock.c: == Using SIP RTP CoS mark 5
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [1100@from-internal:1] Macro("SIP/2000-0000000b", "user-callerid,SKIPTTL,") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:1] Set("SIP/2000-0000000b", "AMPUSER=2000") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:2] GotoIf("SIP/2000-0000000b", "0?report") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:3] ExecIf("SIP/2000-0000000b", "1?Set(REALCALLERIDNUM=2000)") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:4] Set("SIP/2000-0000000b", "AMPUSER=2000") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:5] Set("SIP/2000-0000000b", "AMPUSERCIDNAME=Test2") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:6] GotoIf("SIP/2000-0000000b", "0?report") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:7] Set("SIP/2000-0000000b", "AMPUSERCID=2000") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:8] Set("SIP/2000-0000000b", "CALLERID(all)="Test2" <2000>") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:9] ExecIf("SIP/2000-0000000b", "0?Set(CHANNEL(language)=)") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:10] GotoIf("SIP/2000-0000000b", "1?continue") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Goto (macro-user-callerid,s,19)
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [s@macro-user-callerid:19] NoOp("SIP/2000-0000000b", "Using CallerID "Test2" <2000>") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [1100@from-internal:2] NoCDR("SIP/2000-0000000b", "") in new stack
[Apr 7 19:47:08] VERBOSE[3090] pbx.c: -- Executing [1100@from-internal:3] Wait("SIP/2000-0000000b", "1") in new stack
[Apr 7 19:47:09] VERBOSE[3090] pbx.c: -- Executing [1100@from-internal:4] Playback("SIP/2000-0000000b", "silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer") in new stack
[Apr 7 19:47:09] VERBOSE[3090] file.c: -- <SIP/2000-0000000b> Playing 'silence/1.gsm' (language 'en')
[Apr 7 19:47:10] VERBOSE[3090] file.c: -- <SIP/2000-0000000b> Playing 'cannot-complete-as-dialed.gsm' (language 'en')
[Apr 7 19:47:12] VERBOSE[3090] file.c: -- <SIP/2000-0000000b> Playing 'check-number-dial-again.gsm' (language 'en')
[Apr 7 19:47:15] VERBOSE[3090] pbx.c: -- Executing [1100@from-internal:5] Wait("SIP/2000-0000000b", "1") in new stack
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Executing [1100@from-internal:6] Congestion("SIP/2000-0000000b", "20") in new stack
[Apr 7 19:47:16] WARNING[3090] channel.c: Prodding channel 'SIP/2000-0000000b' failed
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: == Spawn extension (from-internal, 1100, 6) exited non-zero on 'SIP/2000-0000000b'
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Executing [h@from-internal:1] Macro("SIP/2000-0000000b", "hangupcall") in new stack
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Executing [s@macro-hangupcall:1] GotoIf("SIP/2000-0000000b", "1?skiprg") in new stack
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Goto (macro-hangupcall,s,4)
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Executing [s@macro-hangupcall:4] GotoIf("SIP/2000-0000000b", "1?skipblkvm") in new stack
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Goto (macro-hangupcall,s,7)
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Executing [s@macro-hangupcall:7] GotoIf("SIP/2000-0000000b", "1?theend") in new stack
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Goto (macro-hangupcall,s,9)
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: -- Executing [s@macro-hangupcall:9] Hangup("SIP/2000-0000000b", "") in new stack
[Apr 7 19:47:16] VERBOSE[3090] app_macro.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/2000-0000000b' in macro 'hangupcall'
[Apr 7 19:47:16] VERBOSE[3090] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/2000-0000000b'

megahead13
03-07-10, 03:06
Για να μην ανοίγω νέο θέμα, συνεχίζω εδώ. Το Elastix το παράτησα τελικά και είμαι με Asterisk από SVN trunk μια και χρειάζομαι SRTP που δεν υπάρχει στο main branch. Το πρόβλημα τώρα: Έχω δύο servers. Στον πρώτο (με IP 192.168.1.2) έχω ορίσει ως SIP extensions τα 1ΧΧΧ και ως IAX extensions τα 3XXX. Στο δεύτερο (με IP 192.168.2.2) αντίστοιχα είναι 2XXX τα SIP extensions και 4XXX τα IAX extensions. To SIP δουλεύει μια χαρά και τοπικά και μεταξύ των δύο servers. Το IAX trunk μεταξύ των servers όμως έχει πρόβλημα (τοπικά είναι εντάξει). Έτσι, πχ αν ο 3001 (Server A) καλέσει τον 4000 (Server B) η κλήση κόβεται στον πρώτο server με αιτία "No authority found". Από CLI με iax2 show registry και iax2 show peers όλα φαίνονται κανονικά. Παρακάτω τα configurations των δύο servers:

Server A

sip.conf


[general]
register => asterisk1sip:welcome@192.168.2.2/asterisk2sip
register => 1000:1000@192.168.1.2/1000

defaultexpirey=1800
maxexpirey=3600

disallow=all
allow=speex
allow=ulaw
allow=alaw

[asterisk2sip]
type=friend
secret=welcome
context=asterisk2_incoming
host=dynamic

[1000]
type=friend
context=phones
username=1000
secret=1000
host=dynamic
port=5060
nat =yes
qualify=Yes

[1001]
type=friend
context=phones
username=1001
secret=1001
host=dynamic
port=5060

iax.conf


[general]

autokill=yes
requirecalltoken=no
calltokenoptional=0.0.0.0/0.0.0.0
maxcallnumbers=16382

minregexpire=180
maxregexpire=180

register => asterisk1iax:welcome@192.168.2.2
register => 3000:3000@192.168.1.2

[asterisk2iax]
type=friend
host=dynamic
trunk=yes
secret=welcome
context=asterisk2_incoming
deny=0.0.0.0/0.0.0.0
permit=192.168.2.2/255.255.255.255

[3000]
type=friend
context=phones
secret=3000
host=dynamic

[3001]
type=friend
context=phones
secret=3001
host=dynamic

extensions.conf


[globals]

[general]
autofallthrough=yes

[default]
include => phones

[incoming_calls]

[phones]
include => internal
include => remote

[internal]
exten => _1XXX,1,NoOp()
exten => _1XXX,n,Dial(SIP/${EXTEN},30)
exten => _1XXX,n,Playback(demo-congrats)
exten => _1XXX,n,Hangup()

exten => _3XXX,1,NoOp()
exten => _3XXX,n,Dial(IAX2/${EXTEN},30)
exten => _3XXX,n,Playback(demo-abouttotry)
exten => _3XXX,n,Hangup()

[remote]
exten => _2XXX,1,NoOp()
exten => _2XXX,n,Dial(SIP/asterisk1sip/${EXTEN})
exten => _2XXX,n,Hangup()

exten => _4XXX,1,NoOp()
exten => _4XXX,n,Dial(IAX2/asterisk1iax:welcome@192.168.2.2/${EXTEN})
exten => _4XXX,n,Hangup()

[asterisk1_incoming]
include => internal

Server B

sip.conf


[general]
register => asterisk2sip:welcome@192.168.1.2/asterisk1sip
register => 2000:2000@192.168.2.2/2000

defaultexpirey=1800
maxexpirey=3600

disallow=all
allow=speex
allow=ulaw
allow=alaw

[asterisk1sip]
type=friend
secret=welcome
context=asterisk1_incoming
host=dynamic

[2000]
type=friend
context=phones
username=2000
secret=2000
host=dynamic
port=5060
nat =yes
qualify=Yes

[2001]
type=friend
context=phones
username=2001
secret=2001
host=dynamic
port=5060

iax.conf


[general]

autokill=yes
requirecalltoken=no
calltokenoptional=0.0.0.0/0.0.0.0
maxcallnumbers=16382

minregexpire=180
maxregexpire=180

register => asterisk2iax:welcome@192.168.1.2
register => 4000:4000@192.168.2.2

[asterisk1iax]
type=friend
host=dynamic
trunk=yes
secret=welcome
context=asterisk1_incoming
deny=0.0.0.0/0.0.0.0
permit=192.168.1.2/255.255.255.255

[4000]
type=friend
context=phones
secret=4000
host=dynamic

[4001]
type=friend
context=phones
secret=4001
host=dynamic

extensions.conf


[globals]

[general]
autofallthrough=yes

[default]
include => phones

[incoming_calls]

[phones]
include => internal
include => remote

[internal]
exten => _2XXX,1,NoOp()
exten => _2XXX,n,Dial(SIP/${EXTEN},30)
exten => _2XXX,n,Playback(demo-congrats)
exten => _2XXX,n,Hangup()

exten => _4XXX,1,NoOp()
exten => _4XXX,n,Dial(IAX2/${EXTEN},30)
exten => _4XXX,n,Playback(demo-congrats)
exten => _4XXX,n,Hangup()

[remote]
exten => _1XXX,1,NoOp()
exten => _1XXX,n,Dial(SIP/asterisk2sip/${EXTEN})
exten => _1XXX,n,Hangup()

exten => _3XXX,1,NoOp()
exten => _3XXX,n,Dial(IAX2/asterisk2iax:welcome@192.168.1.2/${EXTEN})
exten => _3XXX,n,Hangup()

[asterisk2_incoming]
include => internal

Παραθέτω επίσης το log από το IAX debug στον πρώτο server που υπάρχει το πρόβλημα με το "No authority found"

[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 006 ISeqno: 009 Type: IAX Subclass: ACK
Timestamp: 13895ms SCall: 32378 DCall: 01983 [192.168.1.7:4569]

[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00003ms SCall: 03168 DCall: 00000 [192.168.2.2:4569]


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 03168 DCall: 00001 [192.168.2.2:4569]

[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00008ms SCall: 01816 DCall: 00000 [192.168.2.2:4569]
USERNAME : asterisk2iax
REFRESH : 180


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00011ms SCall: 01816 DCall: 00000 [192.168.2.2:4569]
USERNAME : asterisk2iax
REFRESH : 180
CALLTOKEN : 51 bytes


[KAsterisk1A*CLI>
[0KTx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGAUTH
Timestamp: 00018ms SCall: 02164 DCall: 01816 [192.168.2.2:4569]
AUTHMETHODS : 2
CHALLENGE : \x31\x31\x37\x32\x36\x31\x35\x37\x31
USERNAME : asterisk2iax


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: REGREQ
Timestamp: 00014ms SCall: 01816 DCall: 02164 [192.168.2.2:4569]
USERNAME : asterisk2iax
REFRESH : 180
MD5 RESULT : 96a41d1209abca15e2dbf11c66f2fd67


[KAsterisk1A*CLI>
[0KTx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX Subclass: REGACK
Timestamp: 00019ms SCall: 02164 DCall: 01816 [192.168.2.2:4569]
USERNAME : asterisk2iax
DATE TIME : 2010-07-02 17:00:18
REFRESH : 180
APPARENT ADDRES : IPV4 192.168.2.2:4569


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00019ms SCall: 01816 DCall: 02164 [192.168.2.2:4569]

[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: NEW
Timestamp: 00003ms SCall: 32379 DCall: 00000 [192.168.1.7:4569]
VERSION : 2
CALLING NUMBER :
CALLING NAME :
FORMAT : 5259734
CAPABILITY : 260
USERNAME : 3001
CALLED NUMBER : 4000
DNID : 4000
CALLED CONTEXT : 192.168.2.2

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: AUTHREQ
Timestamp: 00005ms SCall: 00934 DCall: 32379 [192.168.1.7:4569]
AUTHMETHODS : 2
CHALLENGE : \x33\x35\x32\x37\x32\x34\x34\x35\x34
USERNAME : 3001


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: AUTHREP
Timestamp: 00003ms SCall: 32379 DCall: 00934 [192.168.1.7:4569]
MD5 RESULT : 3adf971930f1b328ecf1a88d36c12a0a

Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00003ms SCall: 00934 DCall: 32379 [192.168.1.7:4569]
Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX Subclass: REJECT
Timestamp: 00008ms SCall: 00934 DCall: 32379 [192.168.1.7:4569]
CAUSE : No authority found
CAUSE CODE : 50


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 002 Type: IAX Subclass: ACK
Timestamp: 00008ms SCall: 32379 DCall: 00934 [192.168.1.7:4569]

[KAsterisk1A*CLI>
[0KTx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: POKE
Timestamp: 00004ms SCall: 00036 DCall: 00000 [192.168.2.2:4569]


[KAsterisk1A*CLI>
[0KRx-Frame Retry[Yes] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: PONG
Timestamp: 00004ms SCall: 00001 DCall: 00036 [192.168.2.2:4569]

[KAsterisk1A*CLI>
[0KTx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: ACK
Timestamp: 00004ms SCall: 00036 DCall: 00001 [192.168.2.2:4569]

[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ
Timestamp: 00003ms SCall: 32380 DCall: 00000 [192.168.1.7:4569]
USERNAME : 3001
REFRESH : 60


[KAsterisk1A*CLI>
[0KTx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGAUTH
Timestamp: 00013ms SCall: 11577 DCall: 32380 [192.168.1.7:4569]
AUTHMETHODS : 3
CHALLENGE : \x31\x35\x31\x34\x38\x33\x34\x33\x34
USERNAME : 3001


[KAsterisk1A*CLI>
[0KRx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: REGREQ
Timestamp: 00016ms SCall: 32380 DCall: 11577 [192.168.1.7:4569]
USERNAME : 3001
REFRESH : 60
MD5 RESULT : fc1ad1c6f314a9bebd1765dd89fdee78


[KAsterisk1A*CLI>
[0KTx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX Subclass: REGACK
Timestamp: 00019ms SCall: 11577 DCall: 32380 [192.168.1.7:4569]
USERNAME : 3001
DATE TIME : 2010-07-02 17:00:36
REFRESH : 180
APPARENT ADDRES : IPV4 192.168.1.7:4569

Πού μπορεί να είναι το πρόβλημα;; Κάνω κάπου λάθος στα conf μου;;; :hmm: :hmm: :hmm:

megahead13
06-07-10, 00:37
Τελικά φαίνεται πως το πρόβλημα είναι με τον κώδικα από το SVN. Έκανα εγκατάσταση από source Asterisk 1.4 (άλλη ιστορία γιατί 1.4 και όχι 1.6, αλλά τεσπά) και το IAX2 trunk φαίνεται πως δουλεύει καλά.

@ ADSLgr.com All rights reserved.