[HELP] Newbie can't get SIP softphone to call asterisk serve

I’ve googled and googled and I’m stumped. I am a newbie to asterisk running v. 1.0.9 on host 192.168.2.144, and have SIP softphone sipXphone running on host 192.168.2.101, both hosts on same subnet with no firewall between. sipXphone is set up as ext 200 with secret ‘blah’, and to point at the asterisk server. When dialing an asterisk extension the phone gives message [quote] Your call could not be completed. SIP code: Proxy Authentication Required (407). JTAPI code: Network not allowed (1001)[/quote]
The asterisk console outputs the following while I am attempting the call:[code]asterisk1*CLI>

Sip read:
INVITE sip:*43@192.168.2.144 SIP/2.0
From: sip:200@192.168.2.144;tag=1c13713
To: sip:*43@192.168.2.144
Call-Id: call-1130773851-3@192.168.2.101
Cseq: 1 INVITE
Contact: sip:200@192.168.2.101:5060
Content-Type: application/sdp
Content-Length: 196
Date: Mon, 31 Oct 2005 15:51:01 GMT
Max-Forwards: 20
User-Agent: sipX/2.5.2 (WinNT)
Accept-Language: en
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE
Supported: sip-cc, sip-cc-01, timer, replaces
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-762846f324560aa928bb3b831b637668;rport

v=0
o=sipX 5 5 IN IP4 192.168.2.101
s=phone-call
c=IN IP4 192.168.2.101
t=0 0
m=audio 8766 RTP/AVP 0 8 96
a=rtpmap:0 pcmu/8000/1
a=rtpmap:8 pcma/8000/1
a=rtpmap:96 telephone-event/8000/1

15 headers, 9 lines
Using latest request as basis request
Sending to 192.168.2.101 : 5060 (non-NAT)
Reliably Transmitting (no NAT):
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-762846f324560aa928bb3b831b637668
From: sip:200@192.168.2.144;tag=1c13713
To: sip:*43@192.168.2.144;tag=as7c17f5f4
Call-ID: call-1130773851-3@192.168.2.101
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:*43@192.168.2.144
Proxy-Authenticate: Digest realm=“asterisk”, nonce="036a8067"
Content-Length: 0

to 192.168.2.101:5060
Scheduling destruction of call ‘call-1130773851-3@192.168.2.101’ in 15000 ms
Found user '200’
asterisk1*CLI>

Sip read:
ACK sip:*43@192.168.2.144 SIP/2.0
Contact: sip:200@192.168.2.101:5060
From: sip:200@192.168.2.144;tag=1c13713
To: sip:*43@192.168.2.144;tag=as7c17f5f4
Call-Id: call-1130773851-3@192.168.2.101
Cseq: 1 ACK
Max-Forwards: 20
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-762846f324560aa928bb3b831b637668;rport
Content-Length: 0

9 headers, 0 lines
– Registered to ‘65.39.205.121’, who sees us as 207.154.100.17:4569
Destroying call ‘call-1130773851-3@192.168.2.101’
[/code]

My sip.conf file looks like:

[code]; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn’t, try adding “nat=1” to each peer definition to
; solve translation problems.

[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 = Unknown

#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf
[/code]

and my sip_additional.conf looks like:

[code][200]
username=200
type=friend
secret=blah
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=never
mailbox=200@default
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=“Christopher Wrather” <200>

[201]
username=201
type=friend
secret=blah
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=never
mailbox=201@default
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=“Christopher Wrather” <201>

[/code]

The context [from-internal] looks like

[from-internal] ;allow phones to use applications include => app-directory include => app-dnd include => app-callforward include => app-callwaiting include => app-messagecenter include => app-calltrace include => parkedcalls include => from-internal-custom ;allow phones to dial other extensions include => ext-fax include => ext-local include => ext-group include => ext-queues include => ext-zapbarge include => ext-meetme include => ext-record include => ext-test ;allow phones to access trunks include => outbound-allroutes exten => s,1,Macro(hangupcall) exten => h,1,Macro(hangupcall)

I would really appreciate any help you can give.

Have you tried testing with a different softphone, just to eliminate that variable?

Are you running Asterisk At Home?

From your posted sip.conf, the line that should include your sip_additional.conf is commented out (# is comment delimiter). So it seems like your softphone is never getting defined as a sip channel.

I uncommented that line and, although the call still isn’t going through, it is failing in a different way. Here is the output of the asterisk console:[code]asterisk1*CLI>

Sip read:
INVITE sip:*43@192.168.2.144 SIP/2.0
From: sip:200@192.168.2.144;tag=1c22366
To: sip:*43@192.168.2.144
Call-Id: call-1130779257-5@192.168.2.101
Cseq: 1 INVITE
Contact: sip:200@192.168.2.101:5060
Content-Type: application/sdp
Content-Length: 196
Date: Mon, 31 Oct 2005 17:21:02 GMT
Max-Forwards: 20
User-Agent: sipX/2.5.2 (WinNT)
Accept-Language: en
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE
Supported: sip-cc, sip-cc-01, timer, replaces
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-32560aa9f951669a0484fe83c8e23165;rport

v=0
o=sipX 5 5 IN IP4 192.168.2.101
s=phone-call
c=IN IP4 192.168.2.101
t=0 0
m=audio 8766 RTP/AVP 0 8 96
a=rtpmap:0 pcmu/8000/1
a=rtpmap:8 pcma/8000/1
a=rtpmap:96 telephone-event/8000/1

15 headers, 9 lines
Using latest request as basis request
Sending to 192.168.2.101 : 5060 (non-NAT)
Found no matching peer or user for ‘192.168.2.101:5060’
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 96
Peer audio RTP is at port 192.168.2.101:8766
Found description format pcmu
Found description format pcma
Found description format telephone-event
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0xc (ulaw|alaw)/video=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities: us - 0x1 (g723), peer - 0x1 (g723), combined - 0x1 (g723)
Looking for *43 in from-sip-external
list_route: hop: sip:200@192.168.2.101:5060
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-32560aa9f951669a0484fe83c8e23165
From: sip:200@192.168.2.144;tag=1c22366
To: sip:*43@192.168.2.144
Call-ID: call-1130779257-5@192.168.2.101
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:*43@192.168.2.144
Content-Length: 0

to 192.168.2.101:5060
– Executing AbsoluteTimeout(“SIP/192.168.2.144-09d3a618”, “15”) in new stack
– Set Absolute Timeout to 15
– Executing Congestion(“SIP/192.168.2.144-09d3a618”, “”) in new stack
Transmitting (no NAT):
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-32560aa9f951669a0484fe83c8e23165
From: sip:200@192.168.2.144;tag=1c22366
To: sip:*43@192.168.2.144;tag=as1ec6fa72
Call-ID: call-1130779257-5@192.168.2.101
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:*43@192.168.2.144
Content-Length: 0

to 192.168.2.101:5060
== Spawn extension (from-sip-external, 43, 2) exited non-zero on ‘SIP/192.168.2.144-09d3a618’
– Executing AbsoluteTimeout(“SIP/192.168.2.144-09d3a618”, “15”) in new stack
– Set Absolute Timeout to 15
– Executing Congestion(“SIP/192.168.2.144-09d3a618”, “”) in new stack
== Spawn extension (from-sip-external, h, 2) exited non-zero on ‘SIP/192.168.2.144-09d3a618’
asterisk1
CLI>

Sip read:
ACK sip:*43@192.168.2.144 SIP/2.0
Contact: sip:200@192.168.2.101:5060
From: sip:200@192.168.2.144;tag=1c22366
To: sip:*43@192.168.2.144;tag=as1ec6fa72
Call-Id: call-1130779257-5@192.168.2.101
Cseq: 1 ACK
Max-Forwards: 20
Via: SIP/2.0/UDP 192.168.2.101;branch=z9hG4bK-32560aa9f951669a0484fe83c8e23165;rport
Content-Length: 0

9 headers, 0 lines
Destroying call ‘call-1130779257-5@192.168.2.101’
– Registered to ‘65.39.205.121’, who sees us as 207.154.100.17:4569
asterisk1*CLI>
[/code]Thanks for the help.

Again, are you using Asterisk At Home?

I’m not familiar with it, but it looks suspiciously like a modularized configuration that seems like the kind of thing that AAH uses. The reason I ask is that I think something might have gotten hosed up “higher up” inside AAH. We’re troubleshooting down in the lower levels, but AAH is meant to keep you more at the GUI level. I’m just wondering if something is messed up somewhere in the basic AAH setup?

To the specific problem. So it looks like the problem now is somewhere in the dial plan (extensions.conf and any AAH-specific friends). So, for example, you’re calling the Hangup macro. Where is that defined? Can you post the definition of that macro?

Also, I don’t think you need the sip debug stuff now, since you seem to be establishing a sip connection to asterisk from this phone. It’s just cluttering the console output now.

Yes, I am.

;allow phones to use applications
include => app-directory
include => app-dnd
include => app-callforward
include => app-callwaiting
include => app-messagecenter
include => app-calltrace
include => parkedcalls
include => from-internal-custom
;allow phones to dial other extensions
include => ext-fax
include => ext-local
include => ext-group
include => ext-queues
include => ext-zapbarge
include => ext-meetme
include => ext-record
include => ext-test
;allow phones to access trunks
include => outbound-allroutes
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)

; ############################################################################
; Extension Contexts [ext]
; ############################################################################

[ext-zapbarge]
exten => 888,1,SetGroup(${CALLERIDNUM})
exten => 888,2,Answer
exten => 888,3,Wait(1)
exten => 888,4,ZapBarge
exten => 888,5,Hangup

[ext-meetme]
exten => _8X,1,Answer
exten => _8X,2,Wait(1)
exten => _8X,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8X,4,MeetMe(${EXTEN}|sM)
exten => _8X,5,MeetMe(${EXTEN}|asM)

exten => _8XX,1,Answer
exten => _8XX,2,Wait(1)
exten => _8XX,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8XX,4,MeetMe(${EXTEN}|sM)
exten => _8XX,5,MeetMe(${EXTEN}|asM)

exten => _8XXX,1,Answer
exten => _8XXX,2,Wait(1)
exten => _8XXX,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8XXX,4,MeetMe(${EXTEN}|sM)
exten => _8XXX,5,MeetMe(${EXTEN}|asM)

exten => _8XXXX,1,Answer
exten => _8XXXX,2,Wait(1)
exten => _8XXXX,3,GotoIf($[${CALLERIDNUM} = ${EXTEN:1}]?5:4)
exten => _8XXXX,4,MeetMe(${EXTEN}|sM)
exten => _8XXXX,5,MeetMe(${EXTEN}|asM)

[ext-fax]
exten => s,1,Answer
exten => s,2,Goto(in_fax,1)
exten => in_fax,1,GotoIf($[${FAX_RX} = system]?2:analog_fax,1)
exten => in_fax,2,Macro(faxreceive)
exten => in_fax,3,system(tiff2ps -2eaz -w 8.5 -h 11 ${FAXFILE} | ps2pdf - ${FAXFILE}.pdf)
exten => in_fax,4,system(mime-construct --to ${EMAILADDR} --subject “Fax from ${CALLERIDNUM} ${CALLERIDNAME}” --attachment ${FAXFILE}.pdf --type application/pdf --file ${FAXFILE}.pdf)
exten => in_fax,5,system(rm ${FAXFILE} ${FAXFILE}.pdf)
exten => in_fax,6,Hangup
exten => analog_fax,1,GotoIf($[${FAX_RX} = disabled]?3:2) ;if fax is disabled, just hang up
exten => analog_fax,2,Dial(${FAX_RX},20,d)
exten => analog_fax,3,Hangup
;exten => out_fax,1,wait(7)
exten => out_fax,1,txfax(${TXFAX_NAME}|caller)
exten => out_fax,2,Hangup
exten => h,1,Hangup()

[ext-record]
exten => *77,1,Wait(2)
exten => *77,2,Record(${CALLERIDNUM}ivrrecording:wav)
exten => *77,3,Wait(2)
exten => *77,4,Hangup
exten => *99,1,Playback(${CALLERIDNUM}ivrrecording)
exten => *99,2,Wait(2)
exten => *99,3,Hangup

;this is where parked calls go if they time-out. Should probably re-ring
[default]
include => ext-local
exten => s,1,Playback(vm-goodbye)
exten => s,2,Macro(hangupcall)

[ext-test]
exten => 7777,1,Goto(from-pstn,s,1)
exten => 666,1,Goto(ext-fax,in_fax,1)
exten => h,1,Macro(hangupcall)

;echo test
exten => *43,1,Answer
exten => *43,2,Wait(2)
exten => *43,3,Playback(demo-echotest)
exten => *43,4,Echo
exten => *43,5,Playback(demo-echodone)
exten => *43,6,Hangup[/code]

I guess I need more info to help.

  1. What extension are you dialing?
  2. Can you turn off sip debugging and post the console log that’s displayed when you dial the extension.
  3. Can you post the dial plan for whatever extension you’re dialing. For example, if you’re dialing extension 100, somewhere you have something like:

exten => 100,1,DoSomething…
exten => 100,2,DoSomethingElse…

if any of the DoSomethings are “Macro(…”, go find where the macro is defined. E.g., Macro(DialInternalExt,…) would have a section somewhere like [macro-DialInternalExt]. Post any such macros.

Here is the asterisk console output when dialing *43 from the softphone. My understanding is that this should echo back what I say in the phone, as defined in the extensions.conf file I posted previously. (Have I got this concept wrong??)

asterisk1*CLI>
    -- Executing AbsoluteTimeout("SIP/192.168.2.144-09d3a618", "15") in new stack
    -- Set Absolute Timeout to 15
    -- Executing Congestion("SIP/192.168.2.144-09d3a618", "") in new stack
  == Spawn extension (from-sip-external, *43, 2) exited non-zero on 'SIP/192.168.2.144-09d3a618'
    -- Executing AbsoluteTimeout("SIP/192.168.2.144-09d3a618", "15") in new stack
    -- Set Absolute Timeout to 15
    -- Executing Congestion("SIP/192.168.2.144-09d3a618", "") in new stack
  == Spawn extension (from-sip-external, h, 2) exited non-zero on 'SIP/192.168.2.144-09d3a618'
asterisk1*CLI>

The context I believe I am using is[code][ext-test]
exten => 7777,1,Goto(from-pstn,s,1)
exten => 666,1,Goto(ext-fax,in_fax,1)
exten => h,1,Macro(hangupcall)

;echo test
exten => *43,1,Answer
exten => *43,2,Wait(2)
exten => *43,3,Playback(demo-echotest)
exten => *43,4,Echo
exten => *43,5,Playback(demo-echodone)
exten => *43,6,Hangup[/code]
which is referred to in this context[from-internal] ;allow phones to use applications include => app-directory include => app-dnd include => app-callforward include => app-callwaiting include => app-messagecenter include => app-calltrace include => parkedcalls include => from-internal-custom ;allow phones to dial other extensions include => ext-fax include => ext-local include => ext-group include => ext-queues include => ext-zapbarge include => ext-meetme include => ext-record include => ext-test ;allow phones to access trunks include => outbound-allroutes exten => s,1,Macro(hangupcall) exten => h,1,Macro(hangupcall)both of which are in the extensions.conf file

It looks like it’s routing the call to the from-sip-external context. In your original sip.conf, that’s set up as the default context. If you uncommented the include sip_additional.conf file, you should be overriding that default.

But to ask a few dumb questions:

  • you’re calling from one of those extensions listed in sip_additional.conf, right?
  • when you uncommented the include, you reloaded, right (actually, depending on the version you’re running, you might have to stop and re-start asterisk to reload the sip conf, I’m not really sure)

Anyway, it looks like a configuration issue. Look at the exit status from your call – it says it’s coming from from-sip-external, so it seems to be executing that dialplan.

Hope that helps.

Right, extension 200.

Yes, I reloaded, but I didn’t stop/start asterisk. Worth a try?

Thanks for your help on this. BTW, an “etiquette” question. Is it OK to post to this forum if I’m using Asterisk@home? I figured if it’s not about installing A@H, but a more generic question, it’s OK to post here.

I’ll try stop/start asterisk and report back.

This problem seems to be solved, but it’s not absolutely clear why.

First of all, it turns out that “#include” in the sip.conf file is not a commented out include line, but rather the “#” is part of the include syntax. Go figure. Anyway, the configuration from ext 200 was there all along.

I tried using X-lite, which I had no luck with before, but by setting up a SIP proxy called “Proxy 1” it all started to work. Previously I had set up the “Default Proxy” but it didn’t seem to be invoked when I tried to make a call.

So my problem seems to have been because of some configuration issue with sipXphone, but I’m not sure what.

Thanks to all (esp Greyhound) for the help.