Hallo zusammen,
ich beschäftige mich seit ca. 2 Monaten intensiv mit Asterisk und habe auch einen relativ komplexen Setup zwischen Firma und Homeoffice (jeweils mit i4l/CAPI Anbindung an eine konventionelle Anlage) so hinbekommen, daß ich auch verstehe, warum die Sache funktioniert.
Was ich aber nach nach tagelangem Googlen nicht hinkriege, ist das Verknuspeln von SIP Telefonen mit Asterisk. Die vielen Konzepte mit Proxies, STUN und dergleichen, die oft in einem Atemzug mit SIP genannt werden, verwirren mich im Moment mehr als sie helfen. Auf VoIP Info gibt es ein paar Texte zum Thema, aber wirklich geklickt hat's (noch) nicht.
Konkret habe ich im Moment ein Snom 190 Telefon hier ausgeliehen (192.168.59.142, 91212), was ich an Asterisk 1.0.9 (192.168.59.1) knoten möchte, um damit zu telefonieren. Das Telefon habe ich wie folgt konfiguriert:
In der sip.conf von asterisk habe ich folgendes eingetragen:
Beim Anschließen des Telefons bekomme ich dann folgende Meldungen von Asterisk:
Okay, ohne Host=dynamic akzeptiert Asterisk keine Registratur. Mehr dazu später.
Anrufversuche:
Das Snom unter der 91212 anzurufen bringt mir sofort ein "Besetzt":
Von diesem Telefon aus anrufen geht, auch mit Ton:
Ich verstehe nur nicht, warum mir das Telefon umgekehrt ein Besetzt zurückmeldet.
Wenn ich die sip.conf wie folgt abändere:
So sieht die Sache wieder ganz anders aus. Beim Einschalten des Telefons bekomme ich dann in Asterisk keine Meldungen. Der SIP Trace vom Telefon zeigt mir aber ganz was anderes:
Das versucht das Telefon ein paarmal und gibt dann auf. Asterisk erzeugt hier keine Ausgabe, wie als würde das Paket nicht ankommen. Daß dann Rufe auch nicht funktionieren, liegt auf der Hand.
Ein Ruf vom Snom aus triggert wieder die Registrierung an. Ein Ruf an das Snom sieht so aus:
Witzigerweise signalisiert mir Asterisk ein Freizeichen, das Snom klingelt aber indes nicht.
Was mache ich falsch? Wäre nett, wenn mich jemand auf den Pfad der Erleuchtung führen könnte.
Danke!
:wq! PoC
ich beschäftige mich seit ca. 2 Monaten intensiv mit Asterisk und habe auch einen relativ komplexen Setup zwischen Firma und Homeoffice (jeweils mit i4l/CAPI Anbindung an eine konventionelle Anlage) so hinbekommen, daß ich auch verstehe, warum die Sache funktioniert.
Was ich aber nach nach tagelangem Googlen nicht hinkriege, ist das Verknuspeln von SIP Telefonen mit Asterisk. Die vielen Konzepte mit Proxies, STUN und dergleichen, die oft in einem Atemzug mit SIP genannt werden, verwirren mich im Moment mehr als sie helfen. Auf VoIP Info gibt es ein paar Texte zum Thema, aber wirklich geklickt hat's (noch) nicht.
Konkret habe ich im Moment ein Snom 190 Telefon hier ausgeliehen (192.168.59.142, 91212), was ich an Asterisk 1.0.9 (192.168.59.1) knoten möchte, um damit zu telefonieren. Das Telefon habe ich wie folgt konfiguriert:
Code:
Displayname: Patrik Schindler
Account: 91212
Password: geheim
Registrar: 192.168.59.1
In der sip.conf von asterisk habe ich folgendes eingetragen:
Code:
[general]
port=5060
bindaddr=0.0.0.0
context=sip-in
qualify=no
disallow=all
allow=alaw
allow=alaw
allow=ulaw
allow=g729
allow=gsm
allow=slinear
srvlookup=yes
canreinvite=yes
language=de
nat=no
[91212]
type=friend
host=192.168.59.142
username=91212
secret=geheim
Beim Anschließen des Telefons bekomme ich dann folgende Meldungen von Asterisk:
Sip read:
REGISTER sip:192.168.59.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-h05m6497aoji;rport
From: "PatrikSchindler" <sip:[email protected]>;tag=cj4f0hab8k
To: "PatrikSchindler" <sip:[email protected]>
Call-ID: 3c26700946cd-ebobst9zjxoy@192-168-59-142
CSeq: 1 REGISTER
Max-Forwards: 70
Contact: <sip:[email protected]:5060;line=swl5znhl>;q=1.0
User-Agent: snom190-3.56m
P-NAT-Refresh: 15
Supported: gruu
Allow-Events: dialog
X-Real-IP: 192.168.59.142
WWW-Contact: <http://192.168.59.142:80>
WWW-Contact: <https://192.168.59.142:443>
Expires: 3600
Content-Length: 0
17 headers, 0 lines
Urgent handler
Using latest request as basis request
Sending to 192.168.59.142 : 5060 (non-NAT)
Urgent handler
Jul 27 14:03:20 NOTICE[7688]: chan_sip.c:4922 register_verify: Peer '91212' is trying to register, but not configured as host=dynamic
Transmitting (no NAT):
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-h05m6497aoji
From: "PatrikSchindler" <sip:[email protected]>;tag=cj4f0hab8k
To: "PatrikSchindler" <sip:[email protected]>;tag=as600dac7d
Call-ID: 3c26700946cd-ebobst9zjxoy@192-168-59-142
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:[email protected]>
Content-Length: 0
to 192.168.59.142:5060
Jul 27 14:03:20 NOTICE[7688]: chan_sip.c:7733 handle_request: Registration from '"PatrikSchindler" <sip:[email protected]>' failed for '192.168.59.142'
Scheduling destruction of call '3c26700946cd-ebobst9zjxoy@192-168-59-142' in 15000 ms
Okay, ohne Host=dynamic akzeptiert Asterisk keine Registratur. Mehr dazu später.
Anrufversuche:
Das Snom unter der 91212 anzurufen bringt mir sofort ein "Besetzt":
Dabei ist das Telefon nicht aufgelegt oder ähnliches.-- Executing Answer("Modem[i4l]/ttyI2", "") in new stack
-- Executing WaitExten("Modem[i4l]/ttyI2", "2") in new stack
== CDR updated on Modem[i4l]/ttyI2
-- Executing Dial("Modem[i4l]/ttyI2", "SIP/91212@91212|30|r") in new stack
We're at 192.168.59.1 port 17046
Answering/Requesting with root capability 0x40 (slin)
Answering with preferred capability 0x8 (alaw)
Answering with preferred capability 0x4 (ulaw)
Answering with preferred capability 0x100 (g729)
Answering with preferred capability 0x2 (gsm)
Answering with non-codec capability 0x1 (telephone-event)
12 headers, 14 lines
Reliably Transmitting:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.59.1:5060;branch=z9hG4bK32328096
From: "11" <sip:[email protected]>;tag=as58dd953b
To: <sip:[email protected]>
Contact: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Wed, 27 Jul 2005 12:05:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 314
v=0
o=root 11829 11829 IN IP4 192.168.59.1
s=session
c=IN IP4 192.168.59.1
t=0 0
m=audio 17046 RTP/AVP 10 8 0 18 3 101
a=rtpmap:10 L16/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSuppff - - - -
(no NAT) to 192.168.59.142:5060
-- Called 91212@91212
Sip read:
SIP/2.0 486 Busy Here
Via: SIP/2.0/UDP 192.168.59.1:5060;branch=z9hG4bK32328096
From: "11" <sip:[email protected]>;tag=as58dd953b
To: <sip:[email protected]>;tag=9fsevahwh5
Call-ID: [email protected]
CSeq: 102 INVITE
Contact: <sip:[email protected]:5060;line=swl5znhl>
Content-Length: 0
8 headers, 0 lines
-- Got SIP response 486 "Busy Here" back from 192.168.59.142
Transmitting:
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.59.1:5060;branch=z9hG4bK32328096
From: "11" <sip:[email protected]>;tag=as58dd953b
To: <sip:[email protected]>;tag=9fsevahwh5
Contact: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 102 ACK
User-Agent: Asterisk PBX
Content-Length: 0
(no NAT) to 192.168.59.142:5060
-- SIP/91212-7460 is busy
*CLI> sip show peers
Name/username Host Dyn Nat ACL Mask Port Status
91212/91212 192.168.59.142 255.255.255.255 5060 Unmonitored
Von diesem Telefon aus anrufen geht, auch mit Ton:
Sip read:
INVITE sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-r381sc1zcswi;rport
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 1 INVITE
Max-Forwards: 70
Contact: <sip:[email protected]:5060;line=swl5znhl>
P-Key-Flags: keys="3"
User-Agent: snom190-3.56m
Accept-Language: en
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO
Allow-Events: talk, hold, refer
Supported: timer, 100rel, replaces
Session-Expires: 3600
Content-Type: application/sdp
Content-Length: 346
v=0
o=root 1937665587 1937665587 IN IP4 192.168.59.142
s=call
c=IN IP4 192.168.59.142
t=0 0
m=audio 10004 RTP/AVP 0 8 3 18 4 9 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:18 g729/8000
a=rtpmap:4 g723/8000
a=rtpmap:9 g722/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
18 headers, 16 lines
Using latest request as basis request
Sending to 192.168.59.142 : 5060 (non-NAT)
Reliably Transmitting (no NAT):
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-r381sc1zcswi
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>;tag=as4937ec53
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:[email protected]>
Proxy-Authenticate: Digest realm="asterisk", nonce="0a963aba"
Content-Length: 0
to 192.168.59.142:5060
Scheduling destruction of call '3c2671b42981-rwllquswbewa@192-168-59-142' in 15000 ms
Found user '91212'
Urgent handler
Sip read:
ACK sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-r381sc1zcswi;rport
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>;tag=as4937ec53
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 1 ACK
Max-Forwards: 70
Contact: <sip:[email protected]:5060;line=swl5znhl>
Content-Length: 0
9 headers, 0 lines
Urgent handler
Sip read:
INVITE sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-xmw9287zi38n;rport
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 2 INVITE
Max-Forwards: 70
Contact: <sip:[email protected]:5060;line=swl5znhl>
P-Key-Flags: keys="3"
User-Agent: snom190-3.56m
Accept-Language: en
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO
Allow-Events: talk, hold, refer
Supported: timer, 100rel, replaces
Session-Expires: 3600
Proxy-Authorization: Digest username="91212",realm="asterisk",nonce="0a963aba",uri="sip:[email protected];user=phone",response="cb9a41b8b0a3191ea1ddbdd39d9fcb43",algorithm=md5
Content-Type: application/sdp
Content-Length: 346
v=0
o=root 1937665587 1937665587 IN IP4 192.168.59.142
s=call
c=IN IP4 192.168.59.142
t=0 0
m=audio 10004 RTP/AVP 0 8 3 18 4 9 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:18 g729/8000
a=rtpmap:4 g723/8000
a=rtpmap:9 g722/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
19 headers, 16 lines
Using latest request as basis request
Sending to 192.168.59.142 : 5060 (non-NAT)
Found user '91212'
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 18
Found RTP audio format 4
Found RTP audio format 9
Found RTP audio format 101
Peer audio RTP is at port 192.168.59.142:10004
Found description format pcmu
Found description format pcma
Found description format gsm
Found description format g729
Found description format g723
Found description format g722
Found description format telephone-event
Capabilities: us - 0x14e (gsm|ulaw|alaw|slin|g729), peer - audio=0x10f (g723|gsm|ulaw|alaw|g729)/video=0x0 (nothing), combined - 0x10e (gsm|ulaw|alaw|g729)
Non-codec capabilities: us - 0x1 (g723), peer - 0x1 (g723), combined - 0x1 (g723)
Looking for 11 in sip-in
list_route: hop: <sip:[email protected]:5060;line=swl5znhl>
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-xmw9287zi38n
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:[email protected]>
Content-Length: 0
to 192.168.59.142:5060
-- Executing System("SIP/91212-fc30", "/usr/bin/logger -i -t asterisk -p daemon.info Call from Sip 91212 to 11") in new stack
-- Executing Answer("SIP/91212-fc30", "") in new stack
We're at 192.168.59.1 port 18982
Answering with preferred capability 0x8 (alaw)
Answering with preferred capability 0x4 (ulaw)
Answering with preferred capability 0x100 (g729)
Answering with preferred capability 0x2 (gsm)
Answering with preferred capability 0x40 (slin)
Answering with non-codec capability 0x1 (telephone-event)
Reliably Transmitting (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-xmw9287zi38n
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>;tag=as0b81249d
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:[email protected]>
Content-Type: application/sdp
Content-Length: 314
v=0
o=root 12081 12081 IN IP4 192.168.59.1
s=session
c=IN IP4 192.168.59.1
t=0 0
m=audio 18982 RTP/AVP 8 0 18 3 10 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:3 GSM/8000
a=rtpmap:10 L16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSuppff - - - -
to 192.168.59.142:5060
-- Executing Dial("SIP/91212-fc30", "Modem/g1:11|25|r") in new stack
Jul 27 14:10:27 WARNING[12081]: chan_modem_i4l.c:608 i4l_dial: Outgoing MSN 91212 not allowed (see outgoingmsn=,11,12,13,14,15,16,17,18,90,91,50,49,78, in modem.conf)
-- Called g1:11
Sip read:
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-ykfcxa30i4df;rport
From: "PatrikSchindler" <sip:[email protected]>;tag=kd1r6dol0q
To: <sip:[email protected];user=phone>;tag=as0b81249d
Call-ID: 3c2671b42981-rwllquswbewa@192-168-59-142
CSeq: 2 ACK
Max-Forwards: 70
Contact: <sip:[email protected]:5060;line=swl5znhl>
Content-Length: 0
9 headers, 0 lines
Ich verstehe nur nicht, warum mir das Telefon umgekehrt ein Besetzt zurückmeldet.
Wenn ich die sip.conf wie folgt abändere:
Code:
[91212]
type=friend
defaultip=192.168.59.142
host=dynamic
username=91212
secret=geheim
So sieht die Sache wieder ganz anders aus. Beim Einschalten des Telefons bekomme ich dann in Asterisk keine Meldungen. Der SIP Trace vom Telefon zeigt mir aber ganz was anderes:
Sent to udp:192.168.59.1:5060 at 24/12/2001 00:00:09:270 (601 bytes):
REGISTER sip:192.168.59.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.59.142:5060;branch=z9hG4bK-h05m6497aoji;rport
From: "PatrikSchindler" <sip:[email protected]>;tag=cj4f0hab8k
To: "PatrikSchindler" <sip:[email protected]>
Call-ID: 3c2670093d09-ebobst9zjxoy@192-168-59-142
CSeq: 1 REGISTER
Max-Forwards: 70
Contact: <sip:[email protected]:5060;line=swl5znhl>;q=1.0
User-Agent: snom190-3.56m
P-NAT-Refresh: 15
Supported: gruu
Allow-Events: dialog
X-Real-IP: 192.168.59.142
WWW-Contact: <http://192.168.59.142:80>
WWW-Contact: <https://192.168.59.142:443>
Expires: 3600
Content-Length: 0
Das versucht das Telefon ein paarmal und gibt dann auf. Asterisk erzeugt hier keine Ausgabe, wie als würde das Paket nicht ankommen. Daß dann Rufe auch nicht funktionieren, liegt auf der Hand.
Ein Ruf vom Snom aus triggert wieder die Registrierung an. Ein Ruf an das Snom sieht so aus:
-- Executing Answer("Modem[i4l]/ttyI2", "") in new stack
-- Executing WaitExten("Modem[i4l]/ttyI2", "2") in new stack
== CDR updated on Modem[i4l]/ttyI2
-- Executing Dial("Modem[i4l]/ttyI2", "SIP/91212@91212|30|r") in new stack
We're at 192.168.59.1 port 10406
Answering/Requesting with root capability 0x40 (slin)
Answering with preferred capability 0x8 (alaw)
Answering with preferred capability 0x4 (ulaw)
Answering with preferred capability 0x100 (g729)
Answering with preferred capability 0x2 (gsm)
Answering with non-codec capability 0x1 (telephone-event)
12 headers, 14 lines
Reliably Transmitting:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.59.1:5060;branch=z9hG4bK34decf0b
From: "11" <sip:[email protected]>;tag=as4cd7b3f4
To: <sip:[email protected]>
Contact: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Wed, 27 Jul 2005 12:26:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 314
v=0
o=root 12779 12779 IN IP4 192.168.59.1
s=session
c=IN IP4 192.168.59.1
t=0 0
m=audio 10406 RTP/AVP 10 8 0 18 3 101
a=rtpmap:10 L16/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSuppff - - - -
(no NAT) to 192.168.59.142:5060
-- Called 91212@91212
Witzigerweise signalisiert mir Asterisk ein Freizeichen, das Snom klingelt aber indes nicht.
Was mache ich falsch? Wäre nett, wenn mich jemand auf den Pfad der Erleuchtung führen könnte.
Danke!
:wq! PoC