SIP Incoming. How do you get the call in?????

daudi

Joined
Dec 3, 2008
Messages
5
Likes
0
Points
0
#1
Hi,

I have a problem with getting inbound sip calls from provider. I am new with asterisk but i have dealt with other pbx's. the provider sends me the dialed number which is 1703XXXXXXX. The provider then sends the call to my ip which is natted to my local ip 192.168.200.55. the following is my inbound settings on elastix 1.3

user context = from-internal

Register String = 1703XXXXXXX:123456789@77.208.20.231/9119

what i want to do is to recieve the call and have it ring on extension 9119.

these are the logs from debug set sip ip command.







---
elastix*CLI>
<--- SIP read from 77.208.20.231:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK3bc51225;rport
From: "Unknown" <sip:Unknown@192.168.200.55>;tag=as5a53d4da
To: <sip:77.208.20.231>
Contact: <sip:Unknown@192.168.200.55>
Call-ID: 7d1447d76e695a555230b07b4edc511a@192.168.200.55
CSeq: 102 OPTIONS
User-agent: Asterisk PBX
Max-Forwards: 69
Date: Thu, 08 Jan 2009 16:37:23 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0


<------------->
--- (13 headers 0 lines) ---
Really destroying SIP dialog '7d1447d76e695a555230b07b4edc511a@192.168.200.55' Method: OPTIONS
== Spawn extension (macro-dial, s, 7) exited non-zero on 'Zap/17-1' in macro 'dial'
== Spawn extension (macro-dial, s, 7) exited non-zero on 'Zap/17-1' in macro 'exten-vm'
== Spawn extension (macro-dial, s, 7) exited non-zero on 'Zap/17-1'
-- Executing [h@macro-dial:1] Macro("Zap/17-1", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("Zap/17-1", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("Zap/17-1", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("Zap/17-1", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("Zap/17-1", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("Zap/17-1", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("Zap/17-1", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Zap/17-1' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Zap/17-1'
-- Hungup 'Zap/17-1'
REGISTER 13 headers, 0 lines
Reliably Transmitting (no NAT) to 77.208.20.231:5060:
REGISTER sip:77.208.20.231 SIP/2.0
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK40be0d50;rport
From: <sip:1703XXXXXXX@77.208.20.231>;tag=as1e7b7c1f
To: <sip:1703XXXXXXX@77.208.20.231>
Call-ID: 6dc18ce82e2546dc30a1d539525ac91a@127.0.0.1
CSeq: 128 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username="1703XXXXXXX", realm="sysmaster", algorithm=MD5, uri="sip:77.208.20.231", nonce="00002bb863a37e75b336fc9979f92779", response="7358b26da73fa22a630959484eb50889", opaque="80d5c62b57a9fde5ea18e3ac61ce2010"
Expires: 120
Contact: <sip:9119@192.168.200.55>
Event: registration
Content-Length: 0


---
elastix*CLI>
<--- SIP read from 77.208.20.231:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK40be0d50;rport
From: <sip:1703XXXXXXX@77.208.20.231>;tag=as1e7b7c1f
To: <sip:1703XXXXXXX@77.208.20.231>
Call-ID: 6dc18ce82e2546dc30a1d539525ac91a@127.0.0.1
CSeq: 128 REGISTER
User-agent: Asterisk PBX
Max-Forwards: 69
Authorization: Digest username="1703XXXXXXX", realm="sysmaster", algorithm="MD5", uri="sip:77.208.20.231", nonce="00002bb863a37e75b336fc9979f92779", response="7358b26da73fa22a630959484eb50889", opaque="80d5c62b57a9fde5ea18e3ac61ce2010"
Expires: 120
Contact: <sip:9119@192.168.200.55>
Event: registration
Content-Length: 0
Proxy-Authenticate: Digest realm="sysmaster", nonce="ec12e4af8d544c428ee4295ddf749e2e", opaque="2e98614124523e2e239003c659a06c34", uri="sip:77.208.20.231"


<------------->
--- (14 headers 0 lines) ---
Responding to challenge, registration to domain/host name 77.208.20.231
REGISTER 13 headers, 0 lines
Reliably Transmitting (no NAT) to 77.208.20.231:5060:
REGISTER sip:77.208.20.231 SIP/2.0
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK19806e71;rport
From: <sip:1703XXXXXXX@77.208.20.231>;tag=as35f3984e
To: <sip:1703XXXXXXX@77.208.20.231>
Call-ID: 6dc18ce82e2546dc30a1d539525ac91a@127.0.0.1
CSeq: 129 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Proxy-Authorization: Digest username="1703XXXXXXX", realm="sysmaster", algorithm=MD5, uri="sip:77.208.20.231", nonce="ec12e4af8d544c428ee4295ddf749e2e", response="5489ba65d94aeaf174ef238d3b8e9d8c", opaque="2e98614124523e2e239003c659a06c34"
Expires: 120
Contact: <sip:9119@192.168.200.55>
Event: registration
Content-Length: 0


---
elastix*CLI>
<--- SIP read from 77.208.20.231:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK19806e71;rport
From: <sip:1703XXXXXXX@77.208.20.231>;tag=as35f3984e
To: <sip:1703XXXXXXX@77.208.20.231>
Call-ID: 6dc18ce82e2546dc30a1d539525ac91a@127.0.0.1
CSeq: 129 REGISTER
User-agent: Asterisk PBX
Max-Forwards: 69
Expires: 120
Contact: <sip:9119@192.168.200.55>
Event: registration
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---
Scheduling destruction of SIP dialog '6dc18ce82e2546dc30a1d539525ac91a@127.0.0.1' in 32000 ms (Method: REGISTER)
Reliably Transmitting (NAT) to 77.208.20.231:5060:
OPTIONS sip:77.208.20.231 SIP/2.0
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK0ce95b02;rport
From: "Unknown" <sip:Unknown@192.168.200.55>;tag=as7f5a29b7
To: <sip:77.208.20.231>
Contact: <sip:Unknown@192.168.200.55>
Call-ID: 7bdf48307d2b4bea7315bbc841fcea56@192.168.200.55
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Thu, 08 Jan 2009 16:37:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0


---
elastix*CLI>
<--- SIP read from 77.208.20.231:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.200.55:5060;branch=z9hG4bK0ce95b02;rport
From: "Unknown" <sip:Unknown@192.168.200.55>;tag=as7f5a29b7
To: <sip:77.208.20.231>
Contact: <sip:Unknown@192.168.200.55>
Call-ID: 7bdf48307d2b4bea7315bbc841fcea56@192.168.200.55
CSeq: 102 OPTIONS
User-agent: Asterisk PBX
Max-Forwards: 69
Date: Thu, 08 Jan 2009 16:37:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0


<------------->
--- (13 headers 0 lines) ---
Really destroying SIP dialog '7bdf48307d2b4bea7315bbc841fcea56@192.168.200.55' Method: OPTIONS
elastix*CLI> sip set debug off
SIP Debugging Disabled
 

Mirko87

Joined
Oct 20, 2008
Messages
128
Likes
0
Points
0
#2
Hi, the register string of the trunk must be:
voipnumber: password@provider/voipnumber

Then go to PBX-->Tools-->Asterisk-CLI, and digit:
sip show registry

And post here the result...


Mirko
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0

daudi

Joined
Dec 3, 2008
Messages
5
Likes
0
Points
0
#4
The issue is not registration because i can make outgoing calls without any hithes the problem is having the DID from my provider ring on an extension.

here are the results from sip show registry.

sip show registry
Host Username Refresh State Reg.Time
77.208.20.231:5060 1703XXXXXXX 105 Registered Fri, 09 Jan 2009 15:27:34


by the way i thought inbound was straight forward? Gees!
 

Mirko87

Joined
Oct 20, 2008
Messages
128
Likes
0
Points
0
#5
ok... but in your first post you wrote Register String = 1703XXXXXXX: 123456789@77.208.20.231/9119

Where 9119 is your extension, right?

By the way, in Inbound Routes, set the DID Number 1703XXXXXXX, and on the bottom of the page "set destination"-->extension:9119.

I hope that I succesfully understand your problem...

Mirko
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#6
daudi said:
The issue is not registration because i can make outgoing calls without any hithes the problem is having the DID from my provider ring on an extension.
Just because your registration is successful does not mean that your registration string is entirely correct.

You can register and make outgoing calls even if the information after the / is incorrect. What incorrect information after the / will do is prevent you from receiving INCOMING calls. Sound familiar?

SO... the rule is, the number after the / should match your DID. It should not be your extension number, your birth date, your grandmother's social security number, or anything else. It should be your DID from the provider.

And THEN, you use that EXACT SAME DID in your inbound route. It should EXACTLY match what you put after the / in the registration string, which in turn should exactly match the DID from the provider. Which, in most cases, will be your 11 digit (or possibly 10 digit) telephone number, which in this case would be the same as your username.


here are the results from sip show registry.

sip show registry
Host Username Refresh State Reg.Time
77.208.20.231:5060 1703XXXXXXX 105 Registered Fri, 09 Jan 2009 15:27:34


by the way i thought inbound was straight forward? Gees!
It IS, when you put the correct number after the / in the registration string and then use EXACTLY that same number as the DID in your incoming route. Unless the provider is doing something really funky, but a large majority of the time just having the correct information after the / in the registration string fixes the problem.
 

daudi

Joined
Dec 3, 2008
Messages
5
Likes
0
Points
0
#7
wiseoldowl,

thanks for the insight however i had tried that before and could not get it to work. Just this once i tried it again and still no success.

Current Settings
user context = from-internal

Register String = 1703XXXXXXX: 123456789@77.208.20./1703XXXXXXX

on the inbound route.

1703XXXXXXX has been assigned to ring at extension 9119.

from the earlier logs from the debug, you can see that the provider is sending the correct DID. The interesting thing is that i can only see activity logs from the debug and not the CLI. If i was seeing some activity from the CLI then i would see why the call is not getting to the extension.

by the way if this call is directed to another IP-Pbx (not asterisk), it works (rings on an extension assigned to that Pbx.


am still clueless on how to get this call in. any ideas or work arounds?

Thanks for taking the trouble to look into this issue
 

wiseoldowl

Joined
Aug 19, 2008
Messages
251
Likes
0
Points
0
#8
daudi said:
wiseoldowl,

thanks for the insight however i had tried that before and could not get it to work. Just this once i tried it again and still no success.

Current Settings
user context = from-internal

Register String = 1703XXXXXXX: 123456789@77.208.20./1703XXXXXXX
Really? That's the register string you're using? Gee, I wonder why it doesn't work. Maybe because there's a space where it shouldn't be (after the colon), or an incomplete IP address (missing the final octet). Also, who told you to set the context to from-internal? That's for calls from internal extensions, not from outside trunks.

I'm seriously about ready to stop trying to help you. You apparently seem to think you can do your own thing and then expect things to work. Before you ask any more questions, please download the e-book "Elastix Without Tears" (link is to PDF file) and read and follow the directions on setting up a trunk. Also, I again refer you to the page, "How to get the DID of a SIP trunk when the provider doesn't send it (and why some incoming SIP calls fail)"

Or, just keep putting inappropriate things in your trunk settings, continue to be frustrated by it not working, give up and maybe buy a commercial PBX. Here the thing you have to realize about setting up this type of system: You ABSOLUTELY MUST be willing to put some effort into finding out how to do things correctly. Elastix and FreePBX make it many times easier to set up a working Asterisk box (than configuring dial plans manually), but when things don't work it's still helpful to read the fine documentation, in this case the "Elastix Without Tears" book and the Documentation section of the freepbx.org site. You cannot just type in any old thing in configuration text areas and expect it to work. If you are too impatient or too busy or whatever to read any documentation, then you seriously need to consider paying someone to set up your phone system. Your current settings are NOT correct and frankly it astounds me that you receive calls at all, never mind that they are not going to the correct place.

from the earlier logs from the debug, you can see that the provider is sending the correct DID. The interesting thing is that i can only see activity logs from the debug and not the CLI. If i was seeing some activity from the CLI then i would see why the call is not getting to the extension.
How did you invoke the CLI? Did you SSH into your Asterisk box (or work from a keyboard and monitor connected directly to your Asterisk box) and, from the Linux command prompt, enter something like:

asterisk -rvvvvvvvvvv

(I know that's probably overkill on the v's but I just want to make sure I see everything). If you do that, you should be in the CLI and it should show you how calls are progressing. If it doesn't, that's perhaps another indication that something's really screwed up.

You just MAY have things so messed up already that your only viable option would be to wipe away what you now have and reinstall Elastix from scratch, and this time configure it strictly "by the book." Don't get creative and don't guess as to what should be entered - look it up!
 

daudi

Joined
Dec 3, 2008
Messages
5
Likes
0
Points
0
#9
forget the typos. i took all this time to go through the book. Elastix without tears. apparently i am crying dry tears. I agree with you that something is screwed big time. why i say so is that i have seen some weird stuff happening with my box lately. my callback and disa used to work without any hitches but now when i place i call it doesnt come across.

when making outgoing calls i keep on getting "cannot be completed as dialed" when you press redial it goes through ok and sometime it wont just go thorough.

now am reading on how to back my data (extensions mostly coz i have plenty setup already)

thanks for the help though.

and looking forward to becoming an active and contributing member of this forum.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,938
Messages
130,959
Members
17,632
Latest member
moaulool
Top