SIP trunk not working

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

SIP trunk not working

Postby rsaaris » Tue Mar 13, 2012 8:05 am

Hello,

I've been trying to get SIP trunk to work for outbound dialing but it doesn't seem to be working. The error output from asterisk console is like:

[Mar 13 14:46:57] -- Executing [90XXXXXXXXX@default:1] AGI("SIP/cc100-00000012", "agi://127.0.0.1:4577/call_log") in new stack
[Mar 13 14:46:57] -- AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Mar 13 14:46:57] -- Executing [90XXXXXXXXX@default:2] Dial("SIP/cc100-00000012", "testcarrier:test@10.12.55.100:5060/XXXXXXXXX|30|tTo") in new stack
[Mar 13 14:46:57] WARNING[7688]: channel.c:3765 ast_request: No channel type registered for 'testcarrier:test@10.12.xxx.xxx:5060'
[Mar 13 14:46:57] WARNING[7688]: app_dial.c:1310 dial_exec_full: Unable to create channel of type 'testcarrier:test@10.12.xxx.xxx:5060' (cause 66 - Channel not implemented)
[Mar 13 14:46:57] == Everyone is busy/congested at this time (1:0/0/1)
[Mar 13 14:46:57] -- Executing [90XXXXXXXXX@default:3] Hangup("SIP/cc100-00000012", "") in new stack
[Mar 13 14:46:57] == Spawn extension (default, 90XXXXXXXXX, 3) exited non-zero on 'SIP/cc100-00000012'
[Mar 13 14:46:57] -- Executing [h@default:1] DeadAGI("SIP/cc100-00000012", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----66-----CHANUNAVAIL----------") in new stack
[Mar 13 14:46:57] -- AGI Script agi://127.0.0.1:4577/call_log--HVcauses ... ---------- completed, returning 0

Here is the carrier info from the vicidial admin console:

Registration string: register =>testcarrier:test@10.12.xxx.xxx:5060

Carrier didn't give me any kind of username/password, but it seems to register with that string:
testcarrier/testcarrier 10.12.xxx.xxx D N 5060 OK (1 ms)

Account entry is:
[testcarrier]
disallow=all
allow=ulaw
type=friend
username=testcarrier
secret=test
host=dynamic
dtmfmode=rfc2833
context=trunkinbound

Global string is:
TESTCARRIER = SIP/testcarrier

And the Dialplan entry:
exten => _9358X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9358X.,n,Dial(testcarrier:test@10.12.xxx.xxx:5060/${EXTEN:4},30,tTo)
exten => _9358X.,n,Hangup


exten => _90Z.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _90Z.,n,Dial(testcarrier:test@10.12.xxx.xxx:5060/${EXTEN:2},30,tTo)
exten => _90Z.,n,Hangup

These extensions are working with dahdi channels, so they should be ok.

So what could be wrong in the configuration?

I am using Vicibox 3.1.15. (Asterisk Version 1.4.38-vici, Vicidial VERSION: 2.4-357a BUILD: 120125-2107)
rsaaris
 
Posts: 50
Joined: Wed Dec 07, 2011 6:40 am

Postby fibres » Tue Mar 13, 2012 8:40 am

Hi

So how does the sip provider authenticate? Did you have to give them the static public ip address of your vicidial server?

I suspect that if there is no username/password that they simply except any calls sent from your specified ip address.

Therefore you have no need of a register string. this is only needed if you need to register to the carrier using a user/pass

The main reason I suspect this is not working is due to the host=dynamic option in your account entry.

Therefore you are elling the system to send calls to this entry but then not giving it an ip address.

Change host=dynamic to host=*your provider ip*

Just out of interest is 10.12.xxx.xxx your providers ip or your own server ip? If it is your own servers ip then this would effectively be registering with itself.

This should get you going.

Regards
Vicibox 4.0.3 ISO install.
VERSION: 2.6-393a
BUILD: 130124-1721
Astersik 1.4.44-vici
No Hardware
No other software installed
fibres
 
Posts: 313
Joined: Sun May 20, 2007 3:12 pm
Location: UK

SIP channel

Postby striker » Tue Mar 13, 2012 11:13 am

if your provider supports this kind of registration then u need to use the below dialplan

exten => _9358X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9358X.,n,Dial(SIP/testcarrier:test@10.12.xxx.xxx:5060/${EXTEN:4},30,tTo)
exten => _9358X.,n,Hangup


exten => _90Z.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _90Z.,n,Dial(SIP/testcarrier:test@10.12.xxx.xxx:5060/${EXTEN:2},30,tTo)
exten => _90Z.,n,Hangup

or some provider supports the ip based dialling instead of registration
u can try the below
exten => _9358X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9358X.,n,Dial(SIP/${EXTEN:4}@10.12.XXX.XXX,30,tTo)
exten => _9358X.,n,Hangup
www.striker24x7.com www.youtube.com/c/striker24x7 Telegram/skype id : striker24x7
striker
 
Posts: 962
Joined: Sun Jun 06, 2010 10:25 am

Postby rsaaris » Thu Mar 15, 2012 4:48 am

I got some additional information from my carrier. They said that they don't use registration with their proxy, so the register => string is not needed then?

They also said that when I want to call outbound, I just have to send INVITE to their proxy ip-address (192.168.33.12) from my from my sip-trunk ip (10.12.xxx.xxx) address, and the call will be forwarded.

So how is this done?

I've tried that ip-based dialling, but the calls are not working. The output is:

Executing [9358445224559@default:1] AGI("SIP/cc100-0000004c", "agi://127.0.0.1:4577/call_log") in new stack
[Mar 15 11:34:29] -- AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Mar 15 11:34:29] -- Executing [9358xxxxxxxxx@default:2] Dial("SIP/cc100-0000004c", "SIP/xxxxxxxxx@192.168.33.12|30|tTo") in new stack
[Mar 15 11:34:29] -- Called xxxxxxxxx@192.168.33.12

And then

Executing [9358445224559@default:3] Hangup("SIP/cc100-0000004e", "") in new stack
[Mar 15 11:39:15] == Spawn extension (default, 9358xxxxxxxxx, 3) exited non-zero on 'SIP/cc100-0000004e'
[Mar 15 11:39:15] -- Executing [h@default:1] DeadAGI("SIP/cc100-0000004e", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----16-----NOANSWER----------") in new stack
[Mar 15 11:39:15] -- AGI Script agi://127.0.0.1:4577/call_log--HVcauses ... ---------- completed, returning 0

Sip show peers shows that the peer 192.168.33.12 is UNREACHABLE.

Edit.
I asked my carried to make one trunk that allows registration. Registration times out, and sip debug gives this kind of messages:

[Mar 16 09:43:47] Retransmitting #2 (NAT) to 192.168.33.12:5060:
REGISTER sip:192.168.33.12 SIP/2.0
Via: SIP/2.0/UDP 10.12.55.100:5060;branch=z9hG4bK1aad36ee;rport
From: <sip:xxxxxxxxxxxx@192.168.33.12>;tag=as3bce9bc1
To: <sip:xxxxxxxxxxxx@192.168.33.12>
Call-ID: 52340515633037a0352d4cff60cd7400@10.12.55.100
CSeq: 104 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 120
Contact: <sip:s@10.12.55.100>
Event: registration
Content-Length: 0

From and to -addresses are the same. I don't think that it is supposed to be like that. Should the From address be 10.12.55.100 that is my sip trunk address?
rsaaris
 
Posts: 50
Joined: Wed Dec 07, 2011 6:40 am

Postby rsaaris » Fri Mar 16, 2012 8:19 am

Update about the situation.

The problem lies in traffic routing. All sip traffic is going out from the default gateway (192.168.14.xxx) (eth0), and not from the sip-trunk (eth1). The trunk registers ok when I change the default gateway address to the sip-trunk DG address (10.12.55.1)

So does anybody here know how to route traffic correcly in this kind of situation? Final destination for the sip traffic is 192.168.33.12, eth1 is 10.12.55.100.

Ping is working when I put the following into ip route tables:

ip route add 192.168.33.0/24 dev eth1 src 10.12.55.100 table SIP
ip route add default via 10.12.55.1 dev eth1 table SIP
ip rule add from 192.168.33.1/32 table SIP
ip rule add to 192.168.33.1/32 table SIP

But sip traffic is still going through the default gateway.
rsaaris
 
Posts: 50
Joined: Wed Dec 07, 2011 6:40 am

Postby rsaaris » Tue Mar 20, 2012 2:52 am

Next update.

Sip traffic now routes correctly, but next problem lies somewhere in the sip INVITE authentication. When I try to make outbound call, this is what I get:

Executing [9358xxxxxxxxx@default:1] AGI("SIP/cc101-0000002d", "agi://127.0.0.1:4577/call_log") in new stack
[Mar 20 09:46:12] -- AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Mar 20 09:46:12] -- Executing [9358xxxxxxxxx@default:2] Dial("SIP/cc101-0000002d", "SIP/username:password@192.168.33.12:5060/xxxxxxxxx|30|tTo") in new stack
[Mar 20 09:46:12] -- Called username:password@192.168.33.12:5060/xxxxxxxxx
[Mar 20 09:46:12] NOTICE[2835]: chan_sip.c:13470 handle_response_invite: Failed to authenticate on INVITE to '"station 101" <sip:0000000000@10.12.55.100>;tag=as7de54be2'
[Mar 20 09:46:12] -- SIP/192.168.33.12:5060/xxxxxxxxx-0000002e is circuit-busy
[Mar 20 09:46:12] == Everyone is busy/congested at this time (1:0/1/0)
[Mar 20 09:46:12] -- Executing [9358xxxxxxxxx@default:3] Hangup("SIP/cc101-0000002d", "") in new stack
[Mar 20 09:46:12] == Spawn extension (default, 9358xxxxxxxxx, 3) exited non-zero on 'SIP/cc101-0000002d'
[Mar 20 09:46:12] -- Executing [h@default:1] DeadAGI("SIP/cc101-0000002d", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----21-----CONGESTION----------") in new stack
[Mar 20 09:46:12] -- AGI Script agi://127.0.0.1:4577/call_log--HVcauses ... ---------- completed, returning 0

Inbound calls are working. Could the problem still be in the carriers end?
rsaaris
 
Posts: 50
Joined: Wed Dec 07, 2011 6:40 am

SIP trunk not working

Postby xirin6 » Mon Mar 26, 2012 10:21 am

You may want to edit your sip.conf file and make sure the externip is set properly.
Also you will want to view the asterisk output while attempting to place an outbound call to see where the call is failing and also in asterisk CLI run "sip show peers" to see if your trunk is registered.
xirin6
 
Posts: 22
Joined: Wed Jun 07, 2006 3:24 pm
Location: Florida

Postby xirin6 » Mon Mar 26, 2012 10:33 am

Your provider section should look something like this:

Account Entry:

[SIPTRUNKX]
context=trunkinbound
type=friend
host=10.10.10.10 <------ ip address you are registering to
port=5060
canreinvite=no
disallow=all
allow=g729
allow=ulaw
allow=alaw
dtmfmode=rfc2833

Dialplan Entry:

exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,2,Dial(sip/${EXTEN:1}@SIPTRUNKX,55,tToR)
exten => _91NXXNXXXXXX,3,Hangup
xirin6
 
Posts: 22
Joined: Wed Jun 07, 2006 3:24 pm
Location: Florida

Postby rsaaris » Tue Mar 27, 2012 6:13 am

The problem was in the phone number formatting. Carrier rejected calls if they started with our country code and allowed calls with 0 in front of the phone number. This was not the case with E1 lines.
rsaaris
 
Posts: 50
Joined: Wed Dec 07, 2011 6:40 am


Return to Support

Who is online

Users browsing this forum: No registered users and 262 guests