Help needed to get asterisk working.(SOLVED)

Hello everyone, I have been working at this for over a month and can’t make it work. As you can see it’s a simple configuration no ivr just trying to hit a2billing which works fine with the following setup and it just does not happens for me. I know I’m missing something but can’t even hit the box. I get “your call can not be completed as dialed” I get registration and peer registration. So I decided to post the configuration here with the full log and see if someone can tell me what I’m missing.

Thankyou.

This is my sip.conf file

[general]

bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes
nat=yes
qualify=yes
canreinvite=no ; allow RTP voice traffic to bypass Asterisk
dtmfmode=rfc2833

externip=asteriskserver ;(Your WAN IP)
localnet=localgateway/255.255.255.0

register => username:password@lesnet_peer

;*********************************Lesnet *********************
[lesnet_peer]
type=peer
host=did.voip.les.net
dtmfmode=rfc2833
insecure=very
disallow=all
allow=ulaw
context=a2billing
;*********************************End Lesnet ******************


This is my extensions.conf

[general]

static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[a2billing]
; CallingCard application
exten => _X.,1,Answer
exten => _X.,2,Wait,2
exten => _X.,3,DeadAGI,a2billing.php
exten => _X.,4,Wait,2
exten => _X.,5,Hangup


this is my full log file

Dec 12 11:35:34 VERBOSE[3774] logger.c: – Reloading module ‘cdr_manager.so’ (Asterisk Call Manager CDR Backend)
Dec 12 11:35:34 VERBOSE[3774] logger.c: == Parsing ‘/etc/asterisk/cdr_manager.conf’: Dec 12 11:35:34 VERBOSE[3774]

logger.c: == Parsing ‘/etc/asterisk/cdr_manager.conf’: Found
Dec 12 11:35:34 VERBOSE[3774] logger.c: – Reloading module ‘app_hasnewvoicemail.so’ (Indicator for whether a

voice mailbox has messages in a given folder.)
Dec 12 11:35:34 VERBOSE[3774] logger.c: – Reloading module ‘codec_gsm.so’ (GSM/PCM16 (signed linear) Codec

Translator)
Dec 12 11:35:34 VERBOSE[3774] logger.c: == Parsing ‘/etc/asterisk/codecs.conf’: Dec 12 11:35:34 VERBOSE[3774]

logger.c: == Parsing ‘/etc/asterisk/codecs.conf’: Found
Dec 12 11:35:34 VERBOSE[3774] logger.c: – codec_gsm: using generic PLC
Dec 12 11:35:34 VERBOSE[3774] logger.c: – Reloading module ‘app_meetme.so’ (MeetMe conference bridge)
Dec 12 11:35:34 VERBOSE[3774] logger.c: == Parsing ‘/etc/asterisk/meetme.conf’: Dec 12 11:35:34 VERBOSE[3774]

logger.c: == Parsing ‘/etc/asterisk/meetme.conf’: Found
Dec 12 11:35:34 VERBOSE[3774] logger.c: – Reloading module ‘codec_g726.so’ (ITU G.726-32kbps G726 Transcoder)
Dec 12 11:35:34 VERBOSE[3774] logger.c: == Parsing ‘/etc/asterisk/codecs.conf’: Dec 12 11:35:34 VERBOSE[3774]

logger.c: == Parsing ‘/etc/asterisk/codecs.conf’: Found
Dec 12 11:35:34 VERBOSE[3774] logger.c: – codec_g726: using generic PLC
Dec 12 11:35:34 VERBOSE[2737] logger.c: == Parsing ‘/etc/asterisk/sip_notify.conf’: Dec 12 11:35:34 VERBOSE[2737]

logger.c: == Parsing ‘/etc/asterisk/sip_notify.conf’: Found
Dec 12 11:35:34 DEBUG[2737] acl.c: ##### Testing 64.34.176.212 with xx.xxx.xxx.x
Dec 12 11:35:34 DEBUG[2737] chan_sip.c: Target address 64.34.176.212 is not local, substituting externip
Dec 12 11:35:34 DEBUG[2737] chan_sip.c: Stopping retransmission on '3aae062835906e9d4734787f0a669598@xx.xxx.xxx.x’ of

Request 102: Match Found
Dec 12 11:35:35 DEBUG[2737] acl.c: ##### Testing 64.34.176.212 with xx.xxx.xxx.x
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: Target address 64.34.176.212 is not local, substituting externip
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: Scheduled a registration timeout for lesnet_peer id #502
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on

‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ Request 102: Found
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: Stopping retransmission on ‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ of

Request 102: Match Found
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on

‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ Request 103: Found
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: Stopping retransmission on ‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ of

Request 103: Match Found
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: Registration successful
Dec 12 11:35:35 DEBUG[2737] chan_sip.c: Cancelling timeout 502
Dec 12 11:36:07 DEBUG[2737] chan_sip.c: Auto destroying call ‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’
Dec 12 11:36:34 DEBUG[2737] acl.c: ##### Testing 64.34.176.212 with xx.xxx.xxx.x
Dec 12 11:36:34 DEBUG[2737] chan_sip.c: Target address 64.34.176.212 is not local, substituting externip
Dec 12 11:36:34 DEBUG[2737] chan_sip.c: Stopping retransmission on '4dbb72425fe1f6bb23bfb02544e29e0b@xx.xxx.xxx.x’ of

Request 102: Match Found
Dec 12 11:37:20 DEBUG[2737] acl.c: ##### Testing 64.34.176.212 with xx.xxx.xxx.x
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: Target address 64.34.176.212 is not local, substituting externip
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: Scheduled a registration timeout for lesnet_peer id #510
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on

‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ Request 104: Found
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: Stopping retransmission on ‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ of

Request 104: Match Found
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: (Provisional) Stopping retransmission (but retaining packet) on

‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ Request 105: Found
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: Stopping retransmission on ‘5b67b0f7445389f61a9736c85967f514@127.0.0.1’ of

Request 105: Match Found
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: Registration successful
Dec 12 11:37:20 DEBUG[2737] chan_sip.c: Cancelling timeout 510
Dec 12 11:37:34 DEBUG[2737] acl.c: ##### Testing 64.34.176.212 with xx.xxx.xxx.x
Dec 12 11:37:34 DEBUG[2737] chan_sip.c: Target address 64.34.176.212 is not local, substituting externip
Dec 12 11:37:34 DEBUG[2737] chan_sip.c: Stopping retransmission on '7737272b1b09b

  1. What comes up in the CLI as you are trying to make the call ?
  2. You have: externip=asteriskserver ;(Your WAN IP) - Is this the live config or do you have your external IP up there ?
    3)Under the account settings for lesnet add NAT=yes (I dont think this will make a diffrence but worth trying).
    4)You Have:
[a2billing] 
; CallingCard application 
exten => _X.,1,Answer 
exten => _X.,2,Wait,2 
exten => _X.,3,DeadAGI,a2billing.php 
exten => _X.,4,Wait,2 
exten => _X.,5,Hangup 

Correct syntax:

[a2billing] 
; CallingCard application 
exten => _X.,1,Answer 
exten => _X.,2,Wait(2)
exten => _X.,3,DeadAGI(a2billing.php)
exten => _X.,4,Wai(2)
exten => _X.,5,Hangup 

Thanks for the reply and the help.

I don’t get anything on the cli, that’s why I keep looking at the log.

I have my external ip in the conf. file just didn’t want to post it.

I’ll make the change on the context and change nat=yes.

If i get anything on the cli I’ll post it. Thanks again Dovid.

I dont know why I didnt think of this earlier but try running ethereal. See if anything comes up.

first- try type=friend for the lesnet_peer

do sip show registry. It should show you as registered to the lesnet.

Then try sip debug peer lesnet_peer, and call the thing. You should get a ton of output, post it here.

xxxx.xxxx.xxxx.xxxx = my asterisk box address or externip addreess

SIP Debugging Enabled for IP: 64.34.176.212:5060
Dec 15 14:28:01 NOTICE[2672]: chan_sip.c:5399 sip_reregister: – Re-registration for username@lesnet_peer
REGISTER 13 headers, 0 lines
Reliably Transmitting (no NAT) to 64.34.176.212:5060:
REGISTER sip:lesnet_peer SIP/2.0
Via: SIP/2.0/UDP xxxx.xxxx.xxxx.xxxx:5060;branch=z9hG4bK31d45982;rport
From: sip:username@did.voip.les.net;tag=as03591999
To: sip:username@did.voip.les.net
Call-ID: 542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1
CSeq: 104 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username=“username”, realm=“did.voip.les.net”, algorithm=MD5, uri=“sip:lesnet_peer”, nonce=“4ca27a6f”, response=“a22692880c92f07474adb0e8e2668df4”, opaque=""
Expires: 120
Contact: sip:s@xxxx.xxxx.xxxx.xxxx
Event: registration
Content-Length: 0


asterisk*CLI>
<-- SIP read from 64.34.176.212:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP xxxx.xxxx.xxxx.xxxx:5060;branch=z9hG4bK31d45982;received=xxxx.xxxx.xxxx.xxxx;rport=5060
From: sip:username@did.voip.les.net;tag=as03591999
To: sip:username@did.voip.les.net
Call-ID: 542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1
CSeq: 104 REGISTER
User-Agent: LES.NET.VoIP
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:username@64.34.176.212
Content-Length: 0

— (10 headers 0 lines) —
asterisk*CLI>
<-- SIP read from 64.34.176.212:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP xxxx.xxxx.xxxx.xxxx:5060;branch=z9hG4bK31d45982;received=xxxx.xxxx.xxxx.xxxx;rport=5060
From: sip:username@did.voip.les.net;tag=as03591999
To: sip:username@did.voip.les.net;tag=as3f453eb8
Call-ID: 542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1
CSeq: 104 REGISTER
User-Agent: LES.NET.VoIP
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:username@64.34.176.212
WWW-Authenticate: Digest algorithm=MD5, realm=“did.voip.les.net”, nonce="16a6ffcd"
Content-Length: 0

— (11 headers 0 lines) —
Responding to challenge, registration to domain/host name lesnet_peer
REGISTER 13 headers, 0 lines
Reliably Transmitting (no NAT) to 64.34.176.212:5060:
REGISTER sip:lesnet_peer SIP/2.0
Via: SIP/2.0/UDP xxxx.xxxx.xxxx.xxxx:5060;branch=z9hG4bK31cad964;rport
From: sip:username@did.voip.les.net;tag=as32e628d0
To: sip:username@did.voip.les.net
Call-ID: 542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1
CSeq: 105 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username=“username”, realm=“did.voip.les.net”, algorithm=MD5, uri=“sip:lesnet_peer”, nonce=“16a6ffcd”, response=“b0afc3023b2c2ae8350458b07e46db21”, opaque=""
Expires: 120
Contact: sip:s@xxxx.xxxx.xxxx.xxxx
Event: registration
Content-Length: 0


asterisk*CLI>
<-- SIP read from 64.34.176.212:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP xxxx.xxxx.xxxx.xxxx:5060;branch=z9hG4bK31cad964;received=xxxx.xxxx.xxxx.xxxx;rport=5060
From: sip:username@did.voip.les.net;tag=as32e628d0
To: sip:username@did.voip.les.net
Call-ID: 542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1
CSeq: 105 REGISTER
User-Agent: LES.NET.VoIP
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:username@64.34.176.212
Content-Length: 0

— (10 headers 0 lines) —
asterisk*CLI>
<-- SIP read from 64.34.176.212:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP xxxx.xxxx.xxxx.xxxx:5060;branch=z9hG4bK31cad964;received=xxxx.xxxx.xxxx.xxxx;rport=5060
From: sip:username@did.voip.les.net;tag=as32e628d0
To: sip:username@did.voip.les.net;tag=as3f453eb8
Call-ID: 542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1
CSeq: 105 REGISTER
User-Agent: LES.NET.VoIP
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Expires: 120
Contact: sip:s@xxxx.xxxx.xxxx.xxxx;expires=120
Date: Fri, 15 Dec 2006 19:28:01 GMT
Content-Length: 0

— (12 headers 0 lines) —
Scheduling destruction of call ‘542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1’ in 32000 ms
Dec 15 14:28:01 NOTICE[2672]: chan_sip.c:9895 handle_response_register: Outbound Registration: Expiry for lesnet_peer is 120 sec (Scheduling reregistration in 105 s)
Destroying call '542f6de20ee2b0d8306f28a14d9ce5c3@127.0.0.1’
asterisk*CLI>

the dialog you posted is a successful registration

Asterisk registers
server replies trying
server replies 401 unauthorized, but with hashing info
asterisk registers again using the hashing info and password
server replies trying
server replies okay
and you are registered :smile:

however nowhere in this was an actual call (INVITE) sent or recieved.

correct, even though there is a registration I can get that number to go anywhere. I keep getting "your call can not be completed as dial.

And one more thing, I’m using the extension you sugested, If I have an additional extension I want to add how do I do it. I have the following now.

[context]
exten => 11234567890,1,Goto(s,1) ;how do I add a second extension

Thanks

to get another DID to work:

[context]
exten => 11234567890,1,Goto(s,1) ;how do I add a second extension
exten => PUTDID2HERE,1,Goto(s,1)

To make it so that you can abort and go somewhere else:

[context]
exten => 11234567890,1,Answer()
exten => 11234567890,2,Ringing()
exten => 11234567890,3,WaitExten(1)
exten => 11234567890,4,Goto(s,1)

exten => whatever,1,DoSomethingElse

what this will do is answer the line and play another second of ringing tone, during which you can dial something else.

As for the rest of it- I think your provider might be broken or you are dialing it wrong.

If your account on the provider is set up correctly, and your box is registering to the right account, and the DID works, then dialing it should put SOMETHING into a SIP debug. If Asterisk is rejecting it, then you would see that. But as it is it seems like when you dial it Asterisk gets nothing.
This could be because:

  1. Asterisk isn’t correctly registered (it looks like it is)
  2. You are debugging hte wrong IP (Try generic SIP debug not sip debug peer, if you still get nothing move on)
  3. you are not dialing the number correctly (likely)
  4. the provider has not provisioned the number correctly (possible)

“your call cannot be completed as dialed” is usually used when the call doesn’t go through at all, not when the call goes through but then has nowhere to go…

Thank you for your time everytime I have asked for your help. I got it going. I found most of my problems to be with the DID I have been using. You know I use a termination provider and from an extension at home I call anywhere with excellent quality yet when I tried calling using this particular DID you could not understand the other person nor they could you. I’m not talking about les.net, Les.net is the one I’m using now and everything came back to life. I honestly don’t know what can cause such problem and I’m allways eager to find out why but it’s not worth it. Sure there were a couple of things that gave me a hard time but , when you dial a number and it does not show on the cli as you were telling me, It would make me change the configuration when there was no reason to. I call and communicate then I call 10 times and nothing and it was all in the DID.
This doesn’t mean that I’m not calling on you tomorrow with help over an ivr but so far so good and I’m ready to test.

Thank you. :smiley: