Portál AbcLinuxu, 10. května 2025 09:10

Dotaz: Asterisk - chan_sip.c - not found extension in context

Indiánský lotr avatar 26.3.2012 22:51 Indiánský lotr | skóre: 25 | blog: ucim_sa
Asterisk - chan_sip.c - not found extension in context
Přečteno: 637×
Odpovědět | Admin

Ahoj,

snažím se nakonfigurovat Asterisk SIP. klienti se na server připojí, server komunikuje, ale navzájem nemohou komunikovat. Při pokusu o hovor se v "asterix -r" vypíše chyba: NOTICE[621]: chan_sip.c:22622 handle_request_invite: Call from 'sam' (192.168.2.61:5060) to extension 'scute' rejected because extension not found in context 'home'.

Verze: Asterisk 1.8.10.0

;modules.conf
[modules]
autoload=no
load=chan_sip.so
load=pbx_config.so
load=res_config_sqlite.so
load=res_rtp_asterisk.so
;extensions.conf
[general]
;
static=yes
writeprotect=yes

; The "Globals" category contains global variables that
; can be referenced in the dialplan with ${VARIABLE} or
; ${ENV(VARIABLE)} for Environmental variable
; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
;
[globals]
; ==========================================================
; =============== Dialplan =================================
; ==========================================================

[home]

exten => 100,1,Answer
exten => 100,n,Playback(demo-echotest)
exten => 100,n,Echo()
exten => 100,n,Hangup()

;SIP users
exten => 17,1,Dial(SIP/sam)
exten => 27,1,Dial(SIP/scute)
sip.conf
[general]
bindport = 5060     ; Port to bind to
context = home ; Default context for incoming calls
disallow=all    ; need to disallow=all before we can use allow=
allow=alaw      ; Note: In user sections the order of codecs
dtmfmode=auto   ; Set default dtmfmode for sending DTMF. Default: rfc2833
nat=yes
externip=109.xx.xx.xx
localnet=192.168.2.0/255.255.255.0


[sam]
type=friend
username=sam
secret=heslo
userid=sam <17>
host=dynamic
context = home

[scute]
type=friend
username=scute
secret=heslo
userid=scute <27>
host=dynamic
context = home

Za každou radu budu vděčný, Indiánský lotr


Řešení dotazu:


Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

27.3.2012 00:50 d.c. | skóre: 30
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Odpovědět | | Sbalit | Link | Blokovat | Admin
No, ja bych pro zacatek dal do modules.conf autoload=yes. Rucni vyber modulu je docela vyssi divci...
Indiánský lotr avatar 27.3.2012 05:02 Indiánský lotr | skóre: 25 | blog: ucim_sa
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Autoload nepomohl, stále stejná chybová hláška.
Indiánský lotr avatar 27.3.2012 05:28 Indiánský lotr | skóre: 25 | blog: ucim_sa
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context

Vypis po pridani autoload=yes

[Mar 27 03:26:09] WARNING[599]: res_musiconhold.c:1907 load_module: No music on hold classes configured, disabling music on hold.
SIP channel loading...
[Mar 27 03:26:09] WARNING[599]: chan_sip.c:28645 reload_config: No valid transports available, falling back to 'udp'.
[Mar 27 03:26:09] NOTICE[599]: chan_sip.c:27424 build_peer: The 'username' field for sip peers has been deprecated in favor of the term 'defaultuser'
  == Aliased CLI command 'hangup request' to 'channel request hangup'
  == Aliased CLI command 'originate' to 'channel originate'
  == Aliased CLI command 'help' to 'core show help'
  == Aliased CLI command 'pri intense debug span' to 'pri set debug 2 span'
  == Aliased CLI command 'reload' to 'module reload'
[Mar 27 03:27:24] NOTICE[614]: chan_sip.c:22622 handle_request_invite: Call from 'sam' (192.168.2.61:5060) to extension 'scute' rejected because extension not found in context 'home'.
27.3.2012 07:53 pocitujlasku | skóre: 16
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Odpovědět | | Sbalit | Link | Blokovat | Admin
v extensions.conf mas taketo nieco: exten => 27,1,Dial(SIP/scute) ale nikde nie je definovane scute. Neviem, co ma tento konfigurak robit, ale nemusis kazdeho uzivatela pridavat do extension.conf, len ich zadas do users, ci ako sa to vola, a asterisk si poradi. Vyhod tie riadky pod sip users a pojde to.
Indiánský lotr avatar 27.3.2012 12:30 Indiánský lotr | skóre: 25 | blog: ucim_sa
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Vyzkoušel jsem dle tvé rady, ale bez úspěchu, nešlo by to trošku víc nastínit jak na to?
Indiánský lotr avatar 27.3.2012 17:34 Indiánský lotr | skóre: 25 | blog: ucim_sa
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Muselo to být tím, když: exten => sam,1,Dial(SIP/sam) s tímto to funguje.
27.3.2012 15:41 mozna?
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Odpovědět | | Sbalit | Link | Blokovat | Admin
Zkus zmenit exten => 17,1,Dial(SIP/sam) exten => 27,1,Dial(SIP/scute) za exten => 17,1,Dial(LOCAL/sam) exten => 27,1,Dial(LOCAL/scute)
Indiánský lotr avatar 27.3.2012 15:55 Indiánský lotr | skóre: 25 | blog: ucim_sa
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
nefunguje
Indiánský lotr avatar 27.3.2012 17:46 Indiánský lotr | skóre: 25 | blog: ucim_sa
Rozbalit Rozbalit vše Re: Asterisk - chan_sip.c - not found extension in context
Děkuji za rady funguje to bezvadně i video jsem teď rozchodil, akorát musím ještě najít co použít místo Dial, aby byla kvalita přenosu zvuku lepší, takhle je to hrozné. A ještě zjištění stavu, ukazuje mi stále offline ač se připojí.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.