Koozali.org: home of the SME Server

[Solved]Incoming trunk problems

Offline peterpan746

  • **
  • 55
  • +0/-0
[Solved]Incoming trunk problems
« on: February 17, 2009, 08:20:03 PM »
Hi there,

It's been awhile since I have used SAIL, but I need a multi-tenant system, and SAIL fits the bill.  I have added a carrier, and then the trunk and from what I can see the trunk registers.  The issue I'm having is that when I call the external line (087805xxxx) I can see it hits the box, but the box thinks it needs to go to the same extension as the number.

Code: [Select]
[Feb 17 23:15:15] NOTICE[4641]: chan_sip.c:13885 handle_request_invite: Call from '2787805xxxx' to extension '2787805xxxx' rejected because extension not found.

Any help would be appreciated, for the most part the box will only act as sip server, but will have a group whose VoIP lines terminate on the box.
« Last Edit: February 19, 2009, 01:00:09 AM by peterpan746 »

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Incoming trunk problems
« Reply #1 on: February 17, 2009, 10:03:12 PM »
You need to route the DiD....

Your carrier probabaly gave you instructions to set up the carrier trunk with the account username and password.   Asterisk has to be able to match the incoming number with a routing statement somewhere.  So...  Set up another trunk and choose "PTT_DiD_Group" as the carrier.  Use the dialled number (2787805xxxx - but fill it our completely - no X's or underscores) as the DiD group begin and end number.

Commit that and edit the resulting trunk to route your inbound call to whatever extension or group you choose.

Kind Regards

S


Offline peterpan746

  • **
  • 55
  • +0/-0
Re: Incoming trunk problems
« Reply #2 on: February 17, 2009, 11:44:12 PM »
[Sip Debug:]

REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 196.41.5.20:5060:
REGISTER sip:vphone.co.za SIP/2.0
Via: SIP/2.0/UDP 192.168.2.11:5060;branch=z9hG4bK58cd6342;rport
From: <sip:27878059381@vphone.co.za>;tag=as7ed5140d
To: <sip:27878059381@vphone.co.za>
Call-ID: 26e1f421506bc3244e13577c18788c3c@vphone.co.za
CSeq: 107 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 160
Contact: <sip:27878059381@192.168.2.11>
Event: registration
Content-Length: 0

I take this means that the line registers.

Here is the Sip Debug from an attempted call:

--- (12 headers 16 lines) ---
Sending to 196.41.5.20 : 5060 (no NAT)
Using INVITE request as basis request - SDc7vld01-e84f3489f4d37bf69c8e44c2cf4d9764-4u0uam2
Found peer 'vphone.co.za'
Found RTP audio format 18
Found RTP audio format 96
Found RTP audio format 100
Found RTP audio format 101
Found RTP audio format 102
Found RTP audio format 103
Found RTP audio format 104
Found RTP audio format 105
Peer audio RTP is at port 196.41.5.20:20092
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 96
Found unknown media description format AC100 for ID 100
Found unknown media description format AC101 for ID 101
Found unknown media description format AC102 for ID 102
Found unknown media description format AC103 for ID 103
Found unknown media description format AC104 for ID 104
Found unknown media description format AC105 for ID 105
Capabilities: us - 0x10c (ulaw|alaw|g729), peer - audio=0x100 (g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 196.41.5.20:20092
Looking for 27878059381 in from-pstn (domain 192.168.2.11)

<--- Reliably Transmitting (no NAT) to 196.41.5.20:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKpuafhs00ao4hgegn2100.1;received=196.41.5.20
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDc7vld01-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>;tag=as4dbb0d1c
Call-ID: SDc7vld01-e84f3489f4d37bf69c8e44c2cf4d9764-4u0uam2
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0


<------------>
[Feb 18 02:38:36] NOTICE[4641]: chan_sip.c:13885 handle_request_invite: Call from '27878059381' to extension '27878059381' rejected because extension not found.
Scheduling destruction of SIP dialog 'SDc7vld01-e84f3489f4d37bf69c8e44c2cf4d9764-4u0uam2' in 32000 ms (Method: INVITE)
xchange*CLI>
<--- SIP read from 196.41.5.20:5060 --->
ACK sip:27878059381@192.168.2.11 SIP/2.0
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKpuafhs00ao4hgegn2100.1
CSeq: 1 ACK
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDc7vld01-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>;tag=as4dbb0d1c
Call-ID: SDc7vld01-e84f3489f4d37bf69c8e44c2cf4d9764-4u0uam2
Max-Forwards: 69
Content-Length: 0


The Trunks:
27878059381     Debtlaw     PTT_DiD_Group     LOCAL     N/A           DiD     None     5000     5000

vphone.co.za     Debtlaw     VOX     196.41.5.20     N/A     5060     SIP     None     5000     5000


I hope this helps. I'm at a lost here.

{Edit}
Additional Info (Carrier)

[Peer]
bindaddr=pingtel.no-ip.biz
canreinvite=no
context=from-trunk
fromdomain=vphone.co.za
host=vphone.co.za
insecure=very
nat=no
port=5060
qualify=no
secret=xxxxxx (removed)
type=friend
username=27878059381

[User]
canreinvite=no
context=from-pstn
host=vphone.co.za
insecure=very
nat=no
port=5060
qualify=no
secret=xxxxxxx (removed0
type=friend
username=27878059381

[Trunk]

(Lefthand Window - Labeled vphone.co.za)

bindaddr=pingtel.no-ip.biz
canreinvite=no
context=from-trunk
fromdomain=vphone.co.za
host=vphone.co.za
insecure=very
nat=no
port=5060
qualify=no
secret=xxxxxxx (removed)
type=friend
username=27878059381
disallow=all
allow=g729
allow=alaw
allow=ulaw

(Right hand window - also labeled vphone.co.za)
canreinvite=no
context=from-pstn
host=vphone.co.za
insecure=very
nat=no
port=5060
qualify=no
secret=xxxxxxx (removed)
type=friend
username=27878059381
« Last Edit: February 17, 2009, 11:51:04 PM by peterpan746 »

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Incoming trunk problems
« Reply #3 on: February 18, 2009, 08:55:18 AM »
Hi,

its failing because you have specified freepbx context names in sip.conf (from-pbx and from-pstn).   Sark uses different names.  Completely remove the context= statements from your SIP definitions.

Also - for sip, you need nothing in the SIP USER panel (the right hand window).  So...  remove all statements from the right-hand window.

You should then be good to go.

S

Offline peterpan746

  • **
  • 55
  • +0/-0
Re: Incoming trunk problems
« Reply #4 on: February 18, 2009, 09:05:53 AM »
I have done what you have said:

Now the cli has changed to:

Code: [Select]
xchange*CLI>
    -- Executing [s@mainmenu:1] AGI("SIP/27878059381-b7e3a700", "selintra|CheckState|") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/selintra
    -- AGI Script selintra completed, returning 0
    -- Sent into invalid extension 's' in context 'extensions' on SIP/27878059381-b7e3a700
    -- Executing [i@extensions:1] PlayTones("SIP/27878059381-b7e3a700", "congestion") in new stack
  == Auto fallthrough, channel 'SIP/27878059381-b7e3a700' status is 'UNKNOWN'
    -- Executing [h@extensions:1] Hangup("SIP/27878059381-b7e3a700", "") in new stack
  == Spawn extension (extensions, h, 1) exited non-zero on 'SIP/27878059381-b7e3a700'
xchange*CLI>

This shows for trunk state:
Code: [Select]
Peer vphone not found.

New Sip Debug on attempted call:
Code: [Select]
<--- SIP read from 196.41.5.20:5060 --->
INVITE sip:s@192.168.2.11 SIP/2.0
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKi9mkiu205040ue4000c1.1
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDdvt5301-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>
Call-ID: SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2
CSeq: 1 INVITE
Contact: <sip:27823344624@196.41.5.20:5060;transport=udp>
Remote-Party-ID: "+27823344624" <sip:27823344624@196.3.175.142:5060>;party=calling;screen=yes;Privacy=off
max-forwards: 69
Allow: ACK, NOTIFY, OPTIONS, REFER, INFO, BYE, CANCEL, INVITE
Content-Type: application/sdp
Content-Length: 391

v=0
o=Clarent 101664 101665 IN IP4 196.41.5.20
s=Clarent C5CM
c=IN IP4 196.41.5.20
t=0 0
m=audio 20404 RTP/AVP 18 96 100 101 102 103 104 105
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=rtpmap:100 AC100/8000
a=rtpmap:101 AC101/8000
a=rtpmap:102 AC102/8000
a=rtpmap:103 AC103/8000
a=rtpmap:104 AC104/8000
a=rtpmap:105 AC105/8000

<------------->
--- (12 headers 16 lines) ---
Sending to 196.41.5.20 : 5060 (no NAT)
Using INVITE request as basis request - SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2
Found peer 'vphone.co.za'
Found RTP audio format 18
Found RTP audio format 96
Found RTP audio format 100
Found RTP audio format 101
Found RTP audio format 102
Found RTP audio format 103
Found RTP audio format 104
Found RTP audio format 105
Peer audio RTP is at port 196.41.5.20:20404
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 96
Found unknown media description format AC100 for ID 100
Found unknown media description format AC101 for ID 101
Found unknown media description format AC102 for ID 102
Found unknown media description format AC103 for ID 103
Found unknown media description format AC104 for ID 104
Found unknown media description format AC105 for ID 105
Capabilities: us - 0x10c (ulaw|alaw|g729), peer - audio=0x100 (g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 196.41.5.20:20404
Looking for s in mainmenu (domain 192.168.2.11)
list_route: hop: <sip:27823344624@196.41.5.20:5060;transport=udp>

<--- Transmitting (no NAT) to 196.41.5.20:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKi9mkiu205040ue4000c1.1;received=196.41.5.20
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDdvt5301-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>
Call-ID: SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:s@192.168.2.11>
Content-Length: 0


<------------>
    -- Executing [s@mainmenu:1] AGI("SIP/27878059381-0a0512f0", "selintra|CheckState|") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/selintra
    -- AGI Script selintra completed, returning 0
    -- Sent into invalid extension 's' in context 'extensions' on SIP/27878059381-0a0512f0
    -- Executing [i@extensions:1] PlayTones("SIP/27878059381-0a0512f0", "congestion") in new stack
Audio is at 192.168.2.11 port 16674
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
xchange*CLI>
<--- Transmitting (no NAT) to 196.41.5.20:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKi9mkiu205040ue4000c1.1;received=196.41.5.20
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDdvt5301-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>;tag=as00673717
Call-ID: SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:s@192.168.2.11>
Content-Type: application/sdp
Content-Length: 260

v=0
o=root 22469 22469 IN IP4 192.168.2.11
s=session
c=IN IP4 192.168.2.11
t=0 0
m=audio 16674 RTP/AVP 18 96
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>
  == Auto fallthrough, channel 'SIP/27878059381-0a0512f0' status is 'UNKNOWN'
    -- Executing [h@extensions:1] Hangup("SIP/27878059381-0a0512f0", "") in new stack
  == Spawn extension (extensions, h, 1) exited non-zero on 'SIP/27878059381-0a0512f0'
Scheduling destruction of SIP dialog 'SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2' in 32000 ms (Method: INVITE)
xchange*CLI>
<--- Reliably Transmitting (no NAT) to 196.41.5.20:5060 --->
SIP/2.0 603 Declined
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKi9mkiu205040ue4000c1.1;received=196.41.5.20
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDdvt5301-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>;tag=as00673717
Call-ID: SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:s@192.168.2.11>
Content-Length: 0


<------------>
xchange*CLI>
<--- SIP read from 196.41.5.20:5060 --->
ACK sip:s@192.168.2.11 SIP/2.0
Via: SIP/2.0/UDP 196.41.5.20:5060;branch=z9hG4bKi9mkiu205040ue4000c1.1
CSeq: 1 ACK
From: "+27823344624" <sip:27823344624@196.3.175.142:5060;user=phone>;tag=SDdvt5301-GR52RWG346-34
To: "27878059381@vphone.co.za" <sip:27878059381@vphone.co.za:5060>;tag=as00673717
Call-ID: SDdvt5301-028a4583a0f803ab0160ee3260a808fe-4u0uam2
Max-Forwards: 69
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
[Feb 18 12:11:41] NOTICE[4641]: chan_sip.c:7403 sip_reregister:    -- Re-registration for  27878059381@vphone.co.za
REGISTER 12 headers, 0 lines
Reliably Transmitting (no NAT) to 196.41.5.20:5060:
REGISTER sip:vphone.co.za SIP/2.0
Via: SIP/2.0/UDP 192.168.2.11:5060;branch=z9hG4bK1a84dfb7;rport
From: <sip:27878059381@vphone.co.za>;tag=as667fe3be
To: <sip:27878059381@vphone.co.za>
Call-ID: 1e22280f53c1c9655ddb66e14ad4fc84@vphone.co.za
CSeq: 105 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 160
Contact: <sip:s@192.168.2.11>
Event: registration
Content-Length: 0


---
xchange*CLI>
<--- SIP read from 196.41.5.20:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.11:5060;received=41.240.194.28;branch=z9hG4bK1a84dfb7;rport=5060
From: <sip:27878059381@vphone.co.za>;tag=as667fe3be
To: <sip:27878059381@vphone.co.za>;tag=SDqjjid99-
Call-ID: 1e22280f53c1c9655ddb66e14ad4fc84@vphone.co.za
CSeq: 105 REGISTER
Contact: <sip:s@192.168.2.11>;expires=90
User-Agent: Asterisk PBX
Expires: 90
Event: registration
Allow: ACK, NOTIFY, OPTIONS, REFER, INFO, BYE, CANCEL, INVITE
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---
Scheduling destruction of SIP dialog '1e22280f53c1c9655ddb66e14ad4fc84@vphone.co.za' in 32000 ms (Method: REGISTER)
[Feb 18 12:11:41] NOTICE[4641]: chan_sip.c:12491 handle_response_register: Outbound Registration: Expiry for vphone.co.za is 90 sec (Scheduling reregistration in 75 s)
« Last Edit: February 18, 2009, 09:16:03 AM by peterpan746 »

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Incoming trunk problems
« Reply #5 on: February 18, 2009, 10:29:39 PM »
Did you leave the PTT_DiD_group entry or did you remove it?

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: Incoming trunk problems
« Reply #6 on: February 18, 2009, 10:31:16 PM »
I found to get my did working, I had to change the register string on my sip trunk to

sipusername:password@sipprovider.com/didnumber

Offline peterpan746

  • **
  • 55
  • +0/-0
Re: Incoming trunk problems
« Reply #7 on: February 18, 2009, 10:38:09 PM »
i left it and my registration is same format as above poster

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Incoming trunk problems
« Reply #8 on: February 18, 2009, 10:40:18 PM »
yes, that should do the same thing, but some carriers don't honour it... look at this line here...

Executing [s@mainmenu:1] AGI("SIP/27878059381-b7e3a700", "selintra|CheckState|") in new stack

Asterisk is using the "s" extension, which usually means that it has no DNID (Dialled Number ID).

You can check by doing "agi debug" at the console and then running your call.  It will give you a list of parameters (including DNID) just befoare it calls the agi.

« Last Edit: February 18, 2009, 10:41:57 PM by selintra »

Offline peterpan746

  • **
  • 55
  • +0/-0
Re: Incoming trunk problems
« Reply #9 on: February 18, 2009, 10:46:00 PM »
here is the agi debug
Code: [Select]
<------------>
    -- Executing [s@mainmenu:1] AGI("SIP/27878059381-b7e2d8d8", "selintra|CheckState|") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/selintra
AGI Tx >> agi_request: selintra
AGI Tx >> agi_channel: SIP/27878059381-b7e2d8d8
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1235000673.36
AGI Tx >> agi_callerid: 27823344624
AGI Tx >> agi_calleridname: +27823344624
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: unknown
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: mainmenu
AGI Tx >> agi_extension: s
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << DATABASE GET "STAT" "OCSTAT"
AGI Tx >> 200 result=0
AGI Rx << SET VARIABLE REMOTENUM ""
AGI Tx >> 200 result=1
AGI Rx << SET VARIABLE OPEN "YES"
AGI Tx >> 200 result=1
AGI Rx << DATABASE GET "STAT" "IVRSTAT"
AGI Tx >> 200 result=0
AGI Rx << SET PRIORITY 1
AGI Tx >> 200 result=0
AGI Rx << SET EXTENSION
AGI Tx >> 520-Invalid command syntax.  Proper usage follows:
AGI Tx >>  Usage: SET EXTENSION <new extension>
        Changes the extension for continuation upon exiting the application.
AGI Tx >> 520 End of proper usage.
AGI Rx << SET CONTEXT extensions
AGI Tx >> 200 result=0
    -- AGI Script selintra completed, returning 0
    -- Sent into invalid extension 's' in context 'extensions' on SIP/27878059381-b7e2d8d8
    -- Executing [i@extensions:1] PlayTones("SIP/27878059381-b7e2d8d8", "congestion") in new stack
Audio is at 192.168.2.11 port 19912
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Incoming trunk problems
« Reply #10 on: February 19, 2009, 12:00:33 AM »
As you can see - the call is arriving with no DNID.   SAIL has no code to deal with this because it should never happen.  I suggest you play around with the registration string to see if you can get a dnid delivered.  Whetever value is in there (other than unknown) you should be able to catch and route with a matching PTT_DiD_Group trunk.

Sorry this is a bit vague but I've never seen an empty dnid off a SIP line before.

Kind Regards

S

Offline peterpan746

  • **
  • 55
  • +0/-0
Re: Incoming trunk problems
« Reply #11 on: February 19, 2009, 12:59:44 AM »
I found the problem with the registration string as you said I would.  I was under the impression that I did it in username:password@server/dnid format, but for some reason i left out the dnid.  Once I fixed that the line rang through.

Thank you for your help.