Pls help me


#1

I configured the asterisk with lan ip 192.168.1.128 and public ip 219.82.101.113. One client with ip 192.168.1.13 is in same network with asterisk. NOw i 111 can connect to the asterisk. The remote 222 can connect to my asterisk too.The satus as following.But we cant call each othere. Why ?
Who can help me? I am emrassed by this problem for many days.Pls help me .Thanks. I dont know the reason why cause the status UNREACHABLE.
asterisk1*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
3333/3333 (Unspecified) D 0 Unmonitored
333/333 (Unspecified) D N 0 UNKNOWN
222/222 222.68.38.223 D N 18104 UNREACHABLE
16628938288/16628938288 (Unspecified) D 0 Unmonitored
13388609980/13388609980 (Unspecified) D 0 Unmonitored
13033606623/13033606623 (Unspecified) D 0 Unmonitored
111/111 192.168.1.13 D N 5060 OK (8 ms)
7 sip peers [5 online , 2 offline]

asterisk1CLI> sip show peer 222
asterisk1
CLI>

  • Name : 222
    Secret :
    MD5Secret :
    Context : from-internal
    Subscr.Cont. :
    Language :
    AMA flags : Unknown
    CallingPres : Presentation Allowed, Not Screened
    Callgroup :
    Pickupgroup :
    Mailbox : 222@device
    VM Extension : asterisk
    LastMsgsSent : 0
    Call limit : 0
    Dynamic : Yes
    Callerid : “device” <222>
    Expire : 485
    Insecure : no
    Nat : Always
    ACL : No
    CanReinvite : No
    PromiscRedir : No
    User=Phone : No
    Trust RPID : No
    Send RPID : No
    DTMFmode : rfc2833
    LastMsg : 0
    ToHost :
    Addr->IP : 222.68.38.223 Port 18104
    Defaddr->IP : 0.0.0.0 Port 5060
    Def. Username: 222
    SIP Options : (none)
    Codecs : 0xc (ulaw|alaw)
    Codec Order : (ulaw,alaw)
    Status : UNREACHABLE
    Useragent : X-Lite release 1105x
    Reg. Contact : sip:222@192.168.1.104:5060
    asterisk1CLI>
    asterisk1
    CLI> sip show peer 111
    asterisk1*CLI>

  • Name : 111
    Secret :
    MD5Secret :
    Context : from-internal
    Subscr.Cont. :
    Language :
    AMA flags : Unknown
    CallingPres : Presentation Allowed, Not Screened
    Callgroup :
    Pickupgroup :
    Mailbox : 111@device
    VM Extension : asterisk
    LastMsgsSent : 0
    Call limit : 0
    Dynamic : Yes
    Callerid : “device” <111>
    Expire : 653
    Insecure : no
    Nat : Always
    ACL : No
    CanReinvite : No
    PromiscRedir : No
    User=Phone : No
    Trust RPID : No
    Send RPID : No
    DTMFmode : rfc2833
    LastMsg : 0
    ToHost :
    Addr->IP : 192.168.1.13 Port 5060
    Defaddr->IP : 0.0.0.0 Port 5060
    Def. Username: 111
    SIP Options : (none)
    Codecs : 0xc (ulaw|alaw)
    Codec Order : (ulaw,alaw)
    Status : OK (7 ms)
    Useragent : X-Lite release 1105x
    Reg. Contact : sip:111@192.168.1.13:5060


#2

do you have qualify=yes in your sip.conf for these peers?


#3

Also… enable sip debug, make a test call, and post the results back


#4

Thanks in advance for any good hits !
The two user configured as folowing,101 is a remote user and 111 is in the same network with asterisk:
[101]
username=101
type=friend
secret=101
record_out=Adhoc
record_in=Adhoc
qualify=20
port=5060
nat=yes
mailbox=101@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=yes
callerid=device <101>

[111]
username=111
type=friend
secret=111
record_out=Adhoc
record_in=Adhoc
qualify=20
port=5060
nat=yes
mailbox=111@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=yes
callerid=device <111>

I can see 101 login and dial 43 is ok.But when 101 dial 111, i cant see any information from log and CLI .When 111 dial 101 ,i can see information from CLI. The information as following.But they all failed in dialing.
asterisk1
CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
3333/3333 (Unspecified) D 0 Unmonitored
333/333 (Unspecified) D N 0 UNKNOWN
222/222 (Unspecified) D N 0 UNKNOWN
16628938288/16628938288 (Unspecified) D 0 Unmonitored
13388609980/13388609980 (Unspecified) D 0 Unmonitored
13033606623/13033606623 (Unspecified) D 0 Unmonitored
111/111 192.168.1.13 D N 5060 OK (7 ms)
101/101 220.234.241.161 D N 5060 OK (19 ms)
8 sip peers [6 online , 2 offline]
== Spawn extension (from-internal, *43, 4) exited non-zero on ‘SIP/111-1318’
– Executing Macro(“SIP/111-1318”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/111-1318”, “w”) in new stack
– Executing NoCDR(“SIP/111-1318”, “”) in new stack
– Executing Wait(“SIP/111-1318”, “5”) in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on ‘SIP/111-1318’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/111-1318’
– Executing Macro(“SIP/111-5913”, “exten-vm|novm|101”) in new stack
– Executing Macro(“SIP/111-5913”, “user-callerid”) in new stack
– Executing DBget(“SIP/111-5913”, “AMPUSER=DEVICE/111/user”) in new stack
– DBget: varname=AMPUSER, family=DEVICE, key=111/user
– DBget: set variable AMPUSER to 111
– Executing DBget(“SIP/111-5913”, “AMPUSERCIDNAME=AMPUSER/111/cidname”) in new stack
– DBget: varname=AMPUSERCIDNAME, family=AMPUSER, key=111/cidname
– DBget: set variable AMPUSERCIDNAME to 111
– Executing GotoIf(“SIP/111-5913”, “0?5”) in new stack
– Executing SetCallerID(“SIP/111-5913”, ““111” <111>”) in new stack
– Executing NoOp(“SIP/111-5913”, “Using CallerID “111” <111>”) in new stack
– Executing SetVar(“SIP/111-5913”, “FROMCONTEXT=exten-vm”) in new stack
– Executing Macro(“SIP/111-5913”, “record-enable|101|IN”) in new stack
– Executing GotoIf(“SIP/111-5913”, “0 > 0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing AGI(“SIP/111-5913”, “recordingcheck|19970101-002156|852096116.1”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|19970101-002156|852096116.1: Inbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“SIP/111-5913”, “No recording needed”) in new stack
– Executing Macro(“SIP/111-5913”, “dial|15|tr|101”) in new stack
– Executing GotoIf(“SIP/111-5913”, “0?4:2”) in new stack
– Goto (macro-dial,s,2)
– Executing GotoIf(“SIP/111-5913”, “0?5:4”) in new stack
– Goto (macro-dial,s,4)
– Executing AGI(“SIP/111-5913”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
– AGI Script dialparties.agi completed, returning 0
– Executing NoOp(“SIP/111-5913”, “Returned from dialparties with no extensions to call”) in new stack
– Executing SetVar(“SIP/111-5913”, “DIALSTATUS=BUSY”) in new stack
– Executing GotoIf(“SIP/111-5913”, “0?s-BUSY|1”) in new stack
– Executing GotoIf(“SIP/111-5913”, “1?s-BUSY|1”) in new stack
– Goto (macro-exten-vm,s-BUSY,1)
– Executing NoOp(“SIP/111-5913”, “Extension is reporting BUSY and has no Voicemail”) in new stack
– Executing Busy(“SIP/111-5913”, “”) in new stack
== Spawn extension (macro-exten-vm, s-BUSY, 2) exited non-zero on ‘SIP/111-5913’ in macro ‘exten-vm’
== Spawn extension (from-internal, 101, 1) exited non-zero on ‘SIP/111-5913’
– Executing Macro(“SIP/111-5913”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/111-5913”, “w”) in new stack
– Executing NoCDR(“SIP/111-5913”, “”) in new stack
– Executing Wait(“SIP/111-5913”, “5”) in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on ‘SIP/111-5913’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/111-5913’

In sip.conf,i configured as following:
[general]

port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown1
nat=yes
externip=219.82.102.53
localnet = 192.168.1.0/255.255.255.0
localnet = 192.168.16.0/255.255.255.0
localnet = 220.234.240.0/255.255.252.0
localnet = 10.0.0.0/255.255.255.0

The sub portion of log is as following:

Jan 1 00:46:00 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.1.0
Jan 1 00:46:00 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.16.0
Jan 1 00:46:00 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 220.234.240.0
Jan 1 00:46:00 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 10.0.0.0
Jan 1 00:46:14 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.1.0
Jan 1 00:46:14 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.16.0
Jan 1 00:46:14 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 220.234.240.0
Jan 1 00:46:14 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 10.0.0.0
Jan 1 00:46:28 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.1.0
Jan 1 00:46:28 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.16.0
Jan 1 00:46:28 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 220.234.240.0
Jan 1 00:46:28 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 10.0.0.0
Jan 1 00:46:42 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.1.0
Jan 1 00:46:42 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 192.168.16.0
Jan 1 00:46:42 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 220.234.240.0
Jan 1 00:46:42 DEBUG[3005] acl.c: ##### Testing 220.234.241.161 with 10.0.0.0
Jan 1 00:46:47 DEBUG[3005] acl.c: ##### Testing 192.168.1.13 with 192.168.1.0
Jan 1 00:46:47 DEBUG[3005] acl.c: ##### Testing 192.168.1.13 with 192.168.16.0
Jan 1 00:46:47 DEBUG[3005] acl.c: ##### Testing 192.168.1.13 with 220.234.240.0
Jan 1 00:46:47 DEBUG[3005] acl.c: ##### Testing 192.168.1.13 with 10.0.0.0
Jan 1 00:46:47 DEBUG[3005] chan_sip.c: Stopping retransmission on ‘7a765d8b46d6a82d7cb84dcc318ba8fb@192.168.1.128’ of Request 102: Match Found


#5

Hi,
Can you give me any ideas? Thanks very much!


#6

Comment out: localnet = 220.234.240.0/255.255.252.0

then reload sip and try again


#7

I didnt comment out localnet = 220.234.240.0/255.255.252.0,
There something wrong with [macro-dial] .I modified as following.Then i can call the user and hear the user’s voice clearly.But the user cant call me ,and also i cant see information when the user dial to me. I have use sip debug alreay. Why?
[macro-dial]
;exten => 222,1,Dial(SIP/222)
;exten => s,1,Dial(SIP/101)
exten => s,1,Dial(SIP/${ARG3})
;exten => 101,1,Dial(SIP/101)
;exten => s,1,GotoIf($[ “${MACRO_CONTEXT}” = “macro-rg-group” ]?4:2) ; if this is from rg-group, don’t strip prefix
exten => s,2,GotoIf($["${CALLERIDNAME:0:${LEN(${RGPREFIX})}}" != “${RGPREFIX}”]?5:4) ; check for ring-group prefix
exten => s,3,SetCIDName(${CALLERIDNAME:${LEN(${RGPREFIX})}}) ; strip off prefix
exten => s,4,AGI,dialparties.agi
exten => s,5,NoOp(Returned from dialparties with no extensions to call)
exten => s,6,SetVar(DIALSTATUS=BUSY)
exten => s,10,Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null
exten => s,20,NoOp(Returned from dialparties with hunt groups to dial )
exten => s,21,SetVar(HuntLoop=0)
exten => s,22,GotoIf($[$[${HuntMembers} >= 1]?30 ) ; if this is from rg-group, don’t strip prefix
exten => s,23,NoOp(Returning there are no members left in the hunt group to ring)