TUTORIAL SIP2SIP Settings for PIAF

Joined
Feb 17, 2009
Messages
35
Reaction score
0
I am trying to get sip2sip trunks to work with no luck. I have set up a Nortel 1535 and Blink on sip2sip and they work fine.

When I do
pbx*CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
sip2sip.info:5060 Y 2233492845 120 Request Sent

Any ideas would be helpful!

Here is my trunk settings:


username=22334xxxx
type=peer
canreinvite=yes
secret=xxxxx
qualify=yes
nat=yes
insecure=invite,port
host=81.23.228.150
dtmfmode=rfc2833
disallow=all
context=from-trunk
allow=ulaw&gsm&h263
outboundproxy=proxy.sipthor.net


Register String is
223349xxxx:[email protected]/22334xxxxx
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
I haven't had my S2S register since *1.8. There is a line item in Sip Info section (Peers?) that shows a different IP that it tries to register on and I have added all 3 (that I have found) to the IPTables to let it through but they seem to jump every so often.

There is a post in the Trunks forum of a suggestion to make your host line look like host=a.b.c.d&e.f.g.h&etc...

Now I read & to mean all must be true like registering an operator extension at office and home in 2 locations (as it mentions you can do this in extensions too (in deny/permit)) at all times. So what is the Symbol for an OR instead of an AND -- this may try the first and if it fails do the 2nd and so on.

Worth a shot.
 

vcallaway

Guru
Joined
May 6, 2008
Messages
170
Reaction score
2
Running 1.8.0

Here is my trunk peer settings:
Code:
username=223nnnnnnn
type=peer
canreinvite=no
secret=secret
nat=yes
insecure=invite,port
host=sip2sip.info
dtmfmode=rfc2833
disallow=all
context=from-trunk
allow=h263&g722&ulaw&gsm
qualify=yes

Register string:
Code:
223nnnnnnn:[email protected]/223nnnnnnn

I am having an issue with inbound calls. They connect fine but calls drop after about 30 seconds. Have not had a chance to dive into the issue. I'm using sip2sip for enum registration.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Same settings for me but the trunk never registers -- sits at 120 Request Sent. as I said I don't REALLY need it but since I have it I'd like it to work.
 

tech1

New Member
Joined
May 18, 2011
Messages
14
Reaction score
0
what version of PIAF are u using and what version of Asterisk?
 
Joined
Feb 17, 2009
Messages
35
Reaction score
0
Here is my system info

Asterisk (Ver. 1.8.3.3):
PIAF Ver 1.7.5.6
Centos 5.6
Purple

Still looking for help on getting sip2sip to register!

Thanks!!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Current SIP2SIP settings info is available here: http://wiki.sip2sip.info/projects/sip2sip/wiki/SipDevicesAsterisk

Create a SIP Trunk called sip2sip as shown below. Be sure to add ALL 4 of the hosts in your Peer Details for sip2sip:

Code:
type=peer
canreinvite=no
nat=yes
qualify=yes
domain=sip2sip.info
fromdomain=sip2sip.info
outboundproxy=proxy.sipthor.net
fromuser=223XXXXXXX
defaultuser=223XXXXXXX
secret=yourpassword
insecure=invite
context=from-trunk
host=sip2sip.info&81.23.228.129&81.23.228.150&85.17.186.7

Registration string: 223XXXXXXX:[email protected]/223XXXXXXX

Setting srvlookup=yes in sip_general_custom.conf is mandatory!
Setting enable=yes in dnsmgr.conf is mandatory!

Be sure to WhiteList all 4 hosts in IPtables. Use add-fqdn and add-ip with Travelin' Man 3.

To avoid having to Allow Anonymous Calls, you will need to cut-and-paste the [from-sip-external] context from extensions.conf into extensions_override_freepbx.conf.
Then add a new section for your SIP2SIP-type calls telling it the appropriate Inbound Route. Here's where it should go...

Code:
[from-sip-external]
exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
exten => _.,n,Goto(s,1)
exten => s,1,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?checklang:noanonymous)
 
exten => 223XXXXXXX,1,Dial(local/53669@from-internal)
 
... rest of context goes here

And then... amportal restart
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
New Sip2Sip tutorial with PIAF-Green, Asterisk 11, and FreePBX 2.11 on Nerd Vittles today. Also includes updated ENUM tutorial for ENUM calling that actually works. ;)

Practicing Safe SIP: Adding SIP URI and Free DID Connectivity to Asterisk


callme.gif
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
lgaetz: Thanks. You're absolutely correct on the SIP Settings alternative. Unfortunately, it doesn't work with some of the earlier releases of FreePBX, and we try to keep the setups as generic as possible to avoid further questions/problems. Also worth mentioning is you cannot add srvlookup=yes as a manual entry under the SIP Settings tab, or it fails because FreePBX doesn't remove the default srvlookup=no entry which will override your manual entry. The SIP Settings approach also forces you to add entries for External IP Address and Local Network Subnets which may or may not be necessary for some implementations.

As for enabling DNS Manager, all I can tell you is Sip2Sip won't work without it. There's not much in the way of documentation that I could find either. But it obviously has something to do with the round-robin IP address routing that Sip2Sip uses for its service.
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
142
Reaction score
26
I tried to setup Sip2Sip this morning but end up took me whole day to figure it out what wrong with it.
When I set srvlookup=yes (either in sip_general_custom or in FreePBX sip setting), Every trunks is not register and take very long time for amportal to stop.

I found the problem now. Normally, I setup primary DNS by enter my router IP address which is causing DNS lookup problem. After I enter ISP Primary IP address, everything works like charm.
 

Rrrr

Tink
Joined
May 28, 2009
Messages
343
Reaction score
25
ward

I am using sip2sip for the past few months and its really stable.
I would like to add that that the SIP To: header contains the DID.

In fact, SIP2SIP allows you to create many new aliases for incoming calls just under one single account.
So, if you have a DID service provider that can send your incoming calls to a SIP URI, then you can do as in this example

DID 11231234566 forward to [email protected]
DID 11231234567 forward to [email protected]
DID 11231234568 forward to [email protected]

So you can use this code, found in extensions.conf.
Code:
[from-pstn-toheader]
exten => _.,1,Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
 
Like this:
exten => 223XXXXXXX,1,Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
And then create an inbound route as normal for
11231234566, nerdvittles and for 11231234568

My question to you is, with instructions from previous posts, I am confused as to where best to use this code, should it be in
a) my own [from-trunk-custom-sip2sip] and use this in the sip2sip trunk settings?
b) [from-sip-external] into extensions_override_freepbx.conf and use this in the sip2sip trunk settings?
c) or use [from-pstn-toheader] in the sip2sip trunk settings

What is safest or most common?
 

Rrrr

Tink
Joined
May 28, 2009
Messages
343
Reaction score
25
FWIW: Just one remark regarding the suggested trunk settings for SIP2SIP from the article and as referred above.
Troubleshooting. If you experience intermittent congestion issues with attempted connections to your SIP URI, try the [from-sip-external] trick outlined in our PIAF Forum posting.
and
-- Executing [XXXX@from-sip-external:1] NoOp("SIP/176.9.39.206-00000c5e", "Received incoming SIP connection from unknown peer to XXXX") in new stack

I also encountered issues with receiving calls, the "congestion" issue, but rather than following the trick, I decided to disable the SIP2SIP trunk in Freepbx.
I then installed as per the SIP2SIP wiki article, the trunk registration in sip_registrations_custom.conf and the trunk settings in sip_custom.conf
After this the congestion issue did not appear anymore.

So I did not mess with extensions_override_freepbx.conf, but I messed with two other .conf files. :)
The benefit for me was that I can continue to use Freepbx for inbound routes from SIP2SIP
 

visionlogic

Guru? Nope
Joined
Oct 11, 2009
Messages
117
Reaction score
33
SOLVED! Please pardon my brain fart. Ignore the following.

To avoid having to Allow Anonymous Calls, you will need to cut-and-paste the [from-sip-external] context from extensions.conf into extensions_override_freepbx.conf.
Then add a new section for your SIP2SIP-type calls telling it the appropriate Inbound Route. Here's where it should go...

Code:
[from-sip-external]
exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
exten => _.,n,Goto(s,1)
exten => s,1,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?checklang:noanonymous)
 
exten => 223XXXXXXX,1,Dial(local/53669@from-internal)
 
... rest of context goes here

And then... amportal restart


The insertion of the line "exten => 223XXXXXXX,1,Dial(local/53669@from-internal)" shown above as an example appears to me to route the calls entering on the 223XXXXXXX DID to Lenny. What changes do I need to make to that line in order to route those calls to a specific extension or IVR?
Thanks for your help!
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top