Hello ,
I am trying on 2 PCs, First act as sip server & client (has asterisk & twinkle installed) and the other as a client only(has twinkle only installed) . I made the configuration and Asterisk successfully runned many times and I made a call between the 2 PCs using Ethernet connection (in abscence of wireless).
Only I have one problem, Every time I start running Asterisk to make the call , I run in CLI “sip reload” & “dialplan reload” then "sip show registry " but I found that the 2 PCs are not registered , it is written “request sent” instead , but after some time ( 30 min or more or less ) I found that the 2 PCs are registered succefully when I run the command of “sip show registery” and I can then make the call using twinkle .
Why does it take too long for asterisk to respond ?? is it normal ??
Thanks
You only need to register if you want to be a SIP server. I think you misunderstand the SIP terminology. Sounds like you have two SIP phones and one SIP PABX.
Why are you using dynamic addresses. It sounds as though you know all the addresses.
I suspect the problem is starting the the registrar at the same time as the registrant, rather than running it continuously, resulting in the registration attempt arriving before it is ready.
[quote=“david55”]You only need to register if you want to be a SIP server. I think you misunderstand the SIP terminology. Sounds like you have two SIP phones and one SIP PABX.
Why are you using dynamic addresses. It sounds as though you know all the addresses.
I suspect the problem is starting the the registrar at the same time as the registrant, rather than running it continuously, resulting in the registration attempt arriving before it is ready.[/quote]
Yes I know all the addresses , I want only to make calls between the 2 laps in the same room when they are connected by Ethernet without internet connection. So , from "edit connection " I chose “wired connection” then IPV4 , I gave the 1st lap(server&client) address 192.168.0.1 & Netmask 255.255.255.0 & gateway 0.0.0.0 , for the 2nd one(client) I gave it address 192.168.0.2 & same netmask and gateway.
Do you mean that in sip.conf , I must write this only for server :
register => 100:sarasara@192.168.0.1/internal-phones
peer auth=100:sarasara@192.168.0.1
Ok , I will erease the 2 following lines:
register => 101:saadsaad@192.168.0.1/internal-phones
peer auth=101:saadsaad@192.168.0.1
Since I know all addresses , I have to write in [100] : host=192.168.0.2 & in[101] : host=192.168.0.1?
ok , I will.
you said that :“the problem is starting the the registrar at the same time as the registrant, rather than running it continuously” … How to solve that problem ??? yes , I run asterisk just before making the call and making ethernet connection . Do I have to run it before making the call by 30 min for example ? or what ?
What else must be modified? here are sip.conf & extensions.conf.
Thanks
sip.conf
[general]
bindport=5060
udpbindaddr=192.168.0.1:5060
allowguest=yes
disallow=all
allow=gsm
delayreject=yes
nochecksums=no
pedantic=no
srvlookup=yes
autodomain=yes
sipdebug = yes
domain=192.168.0.1
nat=no
notifyringing=yes
notifyhold=yes
register => 100:sarasara@192.168.0.1/internal-phones
register => 101:saadsaad@192.168.0.1/internal-phones
peer auth=100:sarasara@192.168.0.1
peer auth=101:saadsaad@192.168.0.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[192.168.0.1]
usereqphone = yes
nat=no
fromdomain=192.168.0.1
fromuser=100
secret=sarasara
username=100
context=internal-phones
authname=100
dtmfmode = rfc2833
canreinvite=yes
notifyringing=yes
notifyhold=yes
peer auth=100:sarasara@192.168.0.1
peer auth=101:saadsaad@192.168.0.1
disallow=all
allow=gsm
[100]
type=friend
context=internal-phones
secret=sarasara
nat=no
qualify=no
host=dynamic
dtmfmode = rfc2833
permit=192.168.0.1
[101]
type=friend
context=internal-phones
secret=saadsaad
qualify=no
host=dynamic
nat=no
dtmfmode = rfc2833
permit=192.168.0.1
extensions.conf
[globals]
[general]
exten => 100, 1, dial(SIP/${EXTEN}@192.168.0.1,30)
exten => 100,1,Dial(SIP/100,60)
exten => 101,1,Dial(SIP/101,60)
exten => s,1,Dial(SIP/100,60)
exten => s,2,hangup
[internal-phones]
exten => 100,1,Dial(SIP/100,60)
exten => 101,1,Dial(SIP/101,60)
exten => s,1,Dial(SIP/100,60)
exten => s, 1, dial(SIP/${EXTEN}@192.168.0.1,30)
exten => s,2,hangup
You solve the startup sequencing problem by not stopping the registrar.
Do you mean running Asterisk all time all days and not closing my lap ?! Or I have a misunderstanding ?!
I have two questions , Please
1- When I try to write in sip.conf in “host” parameter , the IP address instead of “dynamic” , I got an output in the CLI -> “No Authentication” But if host=dynamic , I got an output " Registered
2- When I try to call extension 101 , I got “call failed , 404 Not found” & sometimes I got “call unaithorized” but sometimes I can make the call successfully !.. I don’t know why & on what does it depend!!!
I tried to write in the extensions.conf:
[globals]
[general]
[internal-phones]
exten => 100,1,Dial(SIP/100,60)
exten => 101,1,Dial(SIP/101,60)
exten =>200,1,Answer()
same=>n,Playback(hello-world)
same=>n,Hangup()
When I try to call extension 200 from twinkle , also I got "call failed , 404 not found "!!! I am sure that “hello-world” exits , I don’t know what is the problem .
Here is the output in terminal when calling extension 200, Please tell me where is the problem
[Note that here I changed my domain to my wireless IPV4 :192.168.1.2 ,that is written in"connection information" & registration succedded on Asterisk & Twinkle . Hence , No problem in registration - Also when I try to use the IP address of the wired connection which is 192.168.0.1 I got call failed ]
<------------>
Scheduling destruction of SIP dialog ‘vjdqmitcnkteiys@sara-Inspiron-N5010’ in 32000 ms (Method: REGISTER)
<— SIP read from UDP:192.168.1.2:5062 —>
REGISTER sip:192.168.1.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5062;rport;branch=z9hG4bKvuujwlie
Max-Forwards: 70
To: “100” sip:100@192.168.1.2
From: “100” sip:100@192.168.1.2;tag=ezljd
Call-ID: vjdqmitcnkteiys@sara-Inspiron-N5010
CSeq: 160 REGISTER
Authorization: Digest username=“100”,realm=“asterisk”,nonce=“129e1660”,uri=“sip:192.168.1.2”,response=“ff1f2f365327ed1a39eb2810c4022160”,algorithm=MD5
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
User-Agent: Twinkle/1.4.2
Content-Length: 0
<------------->
— (11 headers 0 lines) —
Sending to 192.168.1.2:5062 (no NAT)
<— Transmitting (no NAT) to 192.168.1.2:5062 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.2:5062;branch=z9hG4bKvuujwlie;received=192.168.1.2;rport=5062
From: “100” sip:100@192.168.1.2;tag=ezljd
To: “100” sip:100@192.168.1.2;tag=as3862f68f
Call-ID: vjdqmitcnkteiys@sara-Inspiron-N5010
CSeq: 160 REGISTER
Server: Asterisk PBX 1.8.27.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 108
Contact: sip:100@192.168.1.2:5060;expires=108
Date: Fri, 16 May 2014 11:00:31 GMT
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog ‘vjdqmitcnkteiys@sara-Inspiron-N5010’ in 32000 ms (Method: REGISTER)
<— SIP read from UDP:192.168.1.2:5062 —>
INVITE sip:200@192.168.1.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5062;rport;branch=z9hG4bKajzmfkul
Max-Forwards: 70
To: sip:200@192.168.1.2
From: “100” sip:100@192.168.1.2;tag=uizdm
Call-ID: sboobqzwuvdkksa@sara-Inspiron-N5010
CSeq: 249 INVITE
Contact: sip:100@192.168.1.2:5062
Content-Type: application/sdp
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Supported: replaces,norefersub,100rel
User-Agent: Twinkle/1.4.2
Content-Length: 307
v=0
o=twinkle 1339898127 1466682349 IN IP4 192.168.1.2
s=-
c=IN IP4 192.168.1.2
t=0 0
m=audio 8000 RTP/AVP 98 97 8 0 3 101
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
<------------->
— (13 headers 14 lines) —
Sending to 192.168.1.2:5062 (no NAT)
Using INVITE request as basis request - sboobqzwuvdkksa@sara-Inspiron-N5010
Found peer ‘100’ for ‘100’ from 192.168.1.2:5062
<— Reliably Transmitting (no NAT) to 192.168.1.2:5062 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.2:5062;branch=z9hG4bKajzmfkul;received=192.168.1.2;rport=5062
From: “100” sip:100@192.168.1.2;tag=uizdm
To: sip:200@192.168.1.2;tag=as48255104
Call-ID: sboobqzwuvdkksa@sara-Inspiron-N5010
CSeq: 249 INVITE
Server: Asterisk PBX 1.8.27.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="02ccdc5a"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog ‘sboobqzwuvdkksa@sara-Inspiron-N5010’ in 32000 ms (Method: INVITE)
<— SIP read from UDP:192.168.1.2:5062 —>
ACK sip:200@192.168.1.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5062;rport;branch=z9hG4bKajzmfkul
Max-Forwards: 70
To: sip:200@192.168.1.2;tag=as48255104
From: “100” sip:100@192.168.1.2;tag=uizdm
Call-ID: sboobqzwuvdkksa@sara-Inspiron-N5010
CSeq: 249 ACK
User-Agent: Twinkle/1.4.2
Content-Length: 0
<------------->
— (9 headers 0 lines) —
<— SIP read from UDP:192.168.1.2:5062 —>
INVITE sip:200@192.168.1.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5062;rport;branch=z9hG4bKjphtbbvv
Max-Forwards: 70
To: sip:200@192.168.1.2
From: “100” sip:100@192.168.1.2;tag=uizdm
Call-ID: sboobqzwuvdkksa@sara-Inspiron-N5010
CSeq: 250 INVITE
Contact: sip:100@192.168.1.2:5062
Content-Type: application/sdp
Authorization: Digest username=“100”,realm=“asterisk”,nonce=“02ccdc5a”,uri="sip:200@192.168.1.2",response=“b8e7643d1495918f78e03385034302af”,algorithm=MD5
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Supported: replaces,norefersub,100rel
User-Agent: Twinkle/1.4.2
Content-Length: 307
v=0
o=twinkle 1339898127 1466682349 IN IP4 192.168.1.2
s=-
c=IN IP4 192.168.1.2
t=0 0
m=audio 8000 RTP/AVP 98 97 8 0 3 101
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
<------------->
— (14 headers 14 lines) —
Sending to 192.168.1.2:5062 (no NAT)
Using INVITE request as basis request - sboobqzwuvdkksa@sara-Inspiron-N5010
Found peer ‘100’ for ‘100’ from 192.168.1.2:5062
== Using SIP RTP CoS mark 5
Found RTP audio format 98
Found RTP audio format 97
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 3
Found RTP audio format 101
Found audio description format speex for ID 98
Found audio description format speex for ID 97
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format GSM for ID 3
Found audio description format telephone-event for ID 101
Capabilities: us - 0x2 (gsm), peer - audio=0x20000020e (gsm|ulaw|alaw|speex|speex16)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x2 (gsm)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.1.2:8000
Looking for 200 in internal-phones (domain 192.168.1.2)
<— Reliably Transmitting (no NAT) to 192.168.1.2:5062 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.2:5062;branch=z9hG4bKjphtbbvv;received=192.168.1.2;rport=5062
From: “100” sip:100@192.168.1.2;tag=uizdm
To: sip:200@192.168.1.2;tag=as48255104
Call-ID: sboobqzwuvdkksa@sara-Inspiron-N5010
CSeq: 250 INVITE
Server: Asterisk PBX 1.8.27.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog ‘sboobqzwuvdkksa@sara-Inspiron-N5010’ in 32000 ms (Method: INVITE)
<— SIP read from UDP:192.168.1.2:5062 —>
ACK sip:200@192.168.1.2 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5062;rport;branch=z9hG4bKjphtbbvv
Max-Forwards: 70
To: sip:200@192.168.1.2;tag=as48255104
From: “100” sip:100@192.168.1.2;tag=uizdm
Call-ID: sboobqzwuvdkksa@sara-Inspiron-N5010
CSeq: 250 ACK
Authorization: Digest username=“100”,realm=“asterisk”,nonce=“02ccdc5a”,uri="sip:200@192.168.1.2",response=“b8e7643d1495918f78e03385034302af”,algorithm=MD5
User-Agent: Twinkle/1.4.2
Content-Length: 0
<------------->
— (10 headers 0 lines) —