Couldn't call Trunk_provider

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#1
I'm trying to call to an voip provider , I dial 92636483 and elastix sends only 2636483

I receive this message in the CLI from elastix:

elastix*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
Trunk_provider/12345678 200.40.185.210 5060 OK (20 ms)
DSG_trunk/30 192.168.3.46 5060 Unmonitored
40/40 (Unspecified) D N 0 UNKNOWN
30/30 192.168.3.46 D N 5060 OK (43 ms)
20/20 192.168.3.50 D N 17832 OK (4 ms)
10/10 192.168.3.45 D N 5060 OK (41 ms)
6 sip peers [Monitored: 4 online, 1 offline Unmonitored: 1 online, 0 offline]
elastix*CLI>

Code:
elastix*CLI>
    -- Executing [92636483@from-internal:1] Macro("SIP/10-b750c7c0", "user-callerid|SKIPTTL|") in new stack
    -- Executing [s@macro-user-callerid:1] NoOp("SIP/10-b750c7c0", "user-callerid: device 10") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/10-b750c7c0", "AMPUSER=10") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/10-b750c7c0", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/10-b750c7c0", "1|Set|REALCALLERIDNUM=10") in new stack
    -- Executing [s@macro-user-callerid:5] NoOp("SIP/10-b750c7c0", "REALCALLERIDNUM is 10") in new stack
    -- Executing [s@macro-user-callerid:6] Set("SIP/10-b750c7c0", "AMPUSER=10") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/10-b750c7c0", "AMPUSERCIDNAME=pedro") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/10-b750c7c0", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/10-b750c7c0", "AMPUSERCID=10") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/10-b750c7c0", "CALLERID(all)="pedro" <10>") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/10-b750c7c0", "REALCALLERIDNUM=10") in new stack
    -- Executing [s@macro-user-callerid:12] ExecIf("SIP/10-b750c7c0", "0|Set|CHANNEL(language)=") in new stack
    -- Executing [s@macro-user-callerid:13] NoOp("SIP/10-b750c7c0", "TTL:  ARG1: SKIPTTL") in new stack
    -- Executing [s@macro-user-callerid:14] GotoIf("SIP/10-b750c7c0", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,23)
    -- Executing [s@macro-user-callerid:23] NoOp("SIP/10-b750c7c0", "Using CallerID "pedro" <10>") in new stack
    -- Executing [92636483@from-internal:2] Set("SIP/10-b750c7c0", "_NODEST=") in new stack
    -- Executing [92636483@from-internal:3] Macro("SIP/10-b750c7c0", "record-enable|10|OUT|") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/10-b750c7c0", "0?2:4") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] AGI("SIP/10-b750c7c0", "recordingcheck|20090304-173054|1236205854.110") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
  recordingcheck|20090304-173054|1236205854.110: Outbound recording not enabled
    -- AGI Script recordingcheck completed, returning 0
    -- Executing [s@macro-record-enable:5] NoOp("SIP/10-b750c7c0", "No recording needed") in new stack
    -- Executing [92636483@from-internal:4] Macro("SIP/10-b750c7c0", "dialout-trunk|3|2636483||") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/10-b750c7c0", "DIAL_TRUNK=3") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("SIP/10-b750c7c0", "0|Authenticate|") in new stack
    -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/10-b750c7c0", "0?disabletrunk|1") in new stack
    -- Executing [s@macro-dialout-trunk:4] Set("SIP/10-b750c7c0", "DIAL_NUMBER=2636483") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/10-b750c7c0", "DIAL_TRUNK_OPTIONS=tr") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/10-b750c7c0", "GROUP()=OUT_3") in new stack
    -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/10-b750c7c0", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,9)
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/10-b750c7c0", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:10] Set("SIP/10-b750c7c0", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:11] Macro("SIP/10-b750c7c0", "outbound-callerid|3") in new stack
    -- Executing [s@macro-outbound-callerid:1] GotoIf("SIP/10-b750c7c0", "1?start") in new stack
    -- Goto (macro-outbound-callerid,s,3)
    -- Executing [s@macro-outbound-callerid:3] NoOp("SIP/10-b750c7c0", "REALCALLERIDNUM is 10") in new stack
    -- Executing [s@macro-outbound-callerid:4] GotoIf("SIP/10-b750c7c0", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,9)
    -- Executing [s@macro-outbound-callerid:9] Set("SIP/10-b750c7c0", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:10] Set("SIP/10-b750c7c0", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:11] Set("SIP/10-b750c7c0", "TRUNKOUTCID=<elastix>") in new stack
    -- Executing [s@macro-outbound-callerid:12] GotoIf("SIP/10-b750c7c0", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,16)
    -- Executing [s@macro-outbound-callerid:16] GotoIf("SIP/10-b750c7c0", "0?usercid") in new stack
    -- Executing [s@macro-outbound-callerid:17] Set("SIP/10-b750c7c0", "CALLERID(all)=<elastix>") in new stack
    -- Executing [s@macro-outbound-callerid:18] GotoIf("SIP/10-b750c7c0", "1?report") in new stack
    -- Goto (macro-outbound-callerid,s,22)
    -- Executing [s@macro-outbound-callerid:22] NoOp("SIP/10-b750c7c0", "CallerID set to "" <elastix>") in new stack
    -- Executing [s@macro-dialout-trunk:12] AGI("SIP/10-b750c7c0", "fixlocalprefix") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
    -- AGI Script fixlocalprefix completed, returning 0
    -- Executing [s@macro-dialout-trunk:13] Set("SIP/10-b750c7c0", "OUTNUM=2636483") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/10-b750c7c0", "custom=SIP/Trunk_provider") in new stack
    -- Executing [s@macro-dialout-trunk:15] GotoIf("SIP/10-b750c7c0", "1?gocall") in new stack
    -- Goto (macro-dialout-trunk,s,17)
    -- Executing [s@macro-dialout-trunk:17] Macro("SIP/10-b750c7c0", "dialout-trunk-predial-hook|") in new stack
    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/10-b750c7c0", "0?bypass|1") in new stack
    -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/10-b750c7c0", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:20] Dial("SIP/10-b750c7c0", "SIP/Trunk_provider/2636483|300|") in new stack
    -- Couldn't call Trunk_provider/2636483
Why could be that error?

Pedro
 

ramoncio

Joined
May 12, 2010
Messages
1,663
Likes
0
Points
0
#2
This looks as an outbound route problem.
How did you configure it?
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#3
what are the dial plan you've setup for:
- the extension you are dialing from ?
- the trunk ?
 

agidi

Joined
Jan 13, 2008
Messages
152
Likes
0
Points
0
#4
looks like the 9 is getting grabbed by the default outbound rule.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#5
Hello,

1) Here is my outbound route:

0 9_outside

Dial Patterns = 9|XXXXXXX
Trunk Sequence = 0 SIP/Trunk_provider


2) Here is the trunk configuration:

Outgoin Settings:

allow=g729
canreinvite=no
canredirect=no
disallow=all
dtmfmode=rfc2833
host=200.40.185.210
username=12345678
secret=aaaa
insecure=very
incominglimit=1
nat=no
port=5060
qualify=yes
type=friend

Incoming Settings

USER Context: from-trunk
USER Details:

canreinvite=no
context=from-trunk
fromuser=12345678
qualify=no
secret=aaaa
type=user
username=12345678

Register String:
12345678:aaaa@200.40.185.210/12345678

So, I dial for example 92636483 and elastix is supossed to send to Truk_provider only 2636483

Pedro
 

agidi

Joined
Jan 13, 2008
Messages
152
Likes
0
Points
0
#6
Pedro

The default outbound route, has a 9 prefix dialing.

Some older folks are used to dial 9 before getting out to the PSTN (regular analog tels)

since your number seems to start with a 9, it gets taken care by that outbound route, the nine is deleted, and the rest of the number is transfered to the network.

You can either, delete the 9 rule on the outbound. Try dialing with double 9 ie 99XXXXXX
or make a new rule before the outbound one.

hope this helps
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#7
pedropolian said:
Hello,

1) Here is my outbound route:

0 9_outside

Dial Patterns = 9|XXXXXXX
Trunk Sequence = 0 SIP/Trunk_provider
Pedro

9|xxxxxxx means: every 8 digits number starting with 9, remove the 9.

if you don't want to have to use 9 for external route, just replace this rule by
XXXXXX., that will mean every number with 7 digits or more will be transmitted as dialed.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#8
9XXXXXXX
I dial 2636483

Code:
    -- Goto (macro-dialout-trunk,s,17)

    -- Executing [s@macro-dialout-trunk:17] Macro("SIP/10-b7509348", "dialout-trunk-predial-hook|") in new stack

    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/10-b7509348", "0?bypass|1") in new stack

    -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/10-b7509348", "0?customtrunk") in new stack

    -- Executing [s@macro-dialout-trunk:20] Dial("SIP/10-b7509348", "SIP/Trunk_provider/92636483|300|") in new stack

    -- Couldn't call Trunk_provider/92636483


99XXXXXXX
I dial 992636483

Code:
    -- Goto (macro-dialout-trunk,s,17)

    -- Executing [s@macro-dialout-trunk:17] Macro("SIP/10-b6b03940", "dialout-trunk-predial-hook|") in new stack

    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/10-b6b03940", "0?bypass|1") in new stack

    -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/10-b6b03940", "0?customtrunk") in new stack

    -- Executing [s@macro-dialout-trunk:20] Dial("SIP/10-b6b03940", "SIP/Trunk_provider/992636483|300|") in new stack

    -- Couldn't call Trunk_provider/992636483


XXXXXX.
I dial 2636483

Code:
    -- Goto (macro-dialout-trunk,s,17)

    -- Executing [s@macro-dialout-trunk:17] Macro("SIP/10-b7509348", "dialout-trunk-predial-hook|") in new stack

    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/10-b7509348", "0?bypass|1") in new stack

    -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/10-b7509348", "0?customtrunk") in new stack

    -- Executing [s@macro-dialout-trunk:20] Dial("SIP/10-b7509348", "SIP/Trunk_provider/2636483|300|") in new stack

    -- Couldn't call Trunk_provider/2636483
I did my best :side:

Pedro
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#9
if you leave the trunk dial pattern:
Dial Patterns = 9|XXXXXXX

it will allow only 8 digit number starting with 9, where it will strip the first 9 and transmit only the 7 following digits.

as I wrote before, change your dial pattern for:

XXXXX. to allow any number of 6 digits or more. the X is a digit, the . is any number of digit
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#10
didn't read your last test.

what is the dialing rule required by your provider?
are you register?
if you use the same setting with a softphone, could you dial directly to your provider?

in the cli, enter 'core set verbose 10' and 'sip set debug' and retry to see more information on the trace to see why your trunk refused the call.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#11
This is a message I receive:

elastix*CLI>
<--- SIP read from 200.40.185.210:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.3.161;branch=z9hG4bK1b87068c;received=200.40.185.210;rport=37426
From: <sip:12345678@200.40.185.210>;tag=as0f609f52
To: <sip:12345678@200.40.185.210>;tag=as7abb09a0
Call-ID: 775e0e4019b0ad9f72483a9043b4bf5b@127.0.0.1
CSeq: 160 REGISTER
User-Agent: GATEWAYPSAT2f
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="333a0001"
Content-Length: 0


Why could be that? if I enter sip show peers the trunk seems to be OK:

elastix*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
Trunk_provider/12345678 200.40.185.210 5060 OK (20 ms)
DSG_trunk/30 192.168.3.46 5060 Unmonitored
40/40 (Unspecified) D N 0 UNKNOWN
30/30 192.168.3.46 D N 5060 OK (43 ms)
20/20 192.168.3.50 D N 17832 OK (4 ms)
10/10 192.168.3.45 D N 5060 OK (41 ms)
6 sip peers [Monitored: 4 online, 1 offline Unmonitored: 1 online, 0 offline]
elastix*CLI>


Pedro
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#12
Here is the 200 ok message:

<------------->
--- (11 headers 0 lines) ---
elastix*CLI>
<--- SIP read from 200.40.185.210:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.3.161;branch=z9hG4bK3fef3b16;received=200.40.185.210;rport=37426
From: <sip:12345678@200.40.185.210>;tag=as254414d8
To: <sip:12345678@200.40.185.210>;tag=as79459c80
Call-ID: 775e0e4019b0ad9f72483a9043b4bf5b@127.0.0.1
CSeq: 227 REGISTER
User-Agent: GATEWAYPSAT2f
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Expires: 120
Contact: <sip:12345678@200.40.185.210>;expires=120
Date: Thu, 05 Mar 2009 19:45:08 GMT
Content-Length: 0

Pedro
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#13
did you figure out why you were unauthorized?
Are your trunk settings ok?
check with 'sip show registry' if you are register or not.


in freepbx you have a nice add on called asterisk info that gives you a good overview of all your actual status.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#14
Hi Patrick, thanks for your answer.

Now I'm using a gateway with FXS port in order to register to the same account of Trunk_provider (with the same username and password)

When the gateway sends the register message, there is an important part that it's not included when Elastix try to register:

This the part of the register messeage send from the gateway:

User-Agent: Addpac SIP Gateway
Code:
Autorization: Digest username="12345678", realm="asterisk", nonce="036c71a7", uri="sip:200.40.185.210, response="caadfskjl2342342", algorithm=MD5
I think that I'm unauthorized becaused elastix at the moment of Request: Register doesn't send that part of the message... the rest is almost equal in both cases: gateway and elastix. ___________


Is it possible? What else I can do to make sure that Elastix it's sending the username and the password to Trunk_provider?? _______________


Thanks in advance ______________
Pedro
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#15
you can change the useragent and the realm in the sip.general_custom.conf or also probably in your trunk setup with

useragent =
realm =

you have already put your password and username in the peer detail, it should be ok there.
I've seen you've put allow=g729 then disallow=all. you need to reverse the order: disallow=all, then allow=g729

Also are you sure of your nat=no. You don't have a router/firewall in between?
you probably don't need to put the port as it is the default one.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#16
I tried in

/etc/asterisk/sip_custom.conf
/etc/asterisk/sip_general_custom.conf

with

useragent = Elastix
realm = mirealm

But it didn't work. I also tried to use a public IP for elastix.

I continue getting this error:

-- Couldn't call Trunk_provider/2636483

It's not registered yet, Do you have other ideas why it can't register?

Pedro
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#17
the useragent is there to help you emulate another hardware with provider that required a specific gateway. It is not needed for a standard provider.
The realm could be your domaine name.

I am confused about your problem.

You stated that you received an unauthorized answer then after an OK. What did you change in between. Now you are talking about a gateway.

Did you change the trunk setup since your first posts? If so please post it again.
Give us a full trace of what's happening now with a sip set debug and a core set verbose 10.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#18
Hello Patrick,

The problem was the codec, I installed g723 and g729 from http://asterisk.hosting.lv/ instead of ulaw/alaw.

Thanks anyway,

Pedro
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#19
ulaw and alaw are installed by default.
 

pedropolian

Joined
Mar 2, 2009
Messages
20
Likes
0
Points
0
#20
Yes, it's true. So I didn't realize my sip Trunk_provider don't allow ulaw and alaw. Because of that I needed to use g723 and g729. I installed then and it worked.

Pedro
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,887
Members
17,565
Latest member
omarmenichetti
Top