SIP in - SIP out behind same public IP

Support zone
Post Reply
User avatar
jwouters
Posts: 5
Joined: Wed Jan 18, 2012 1:51 pm

SIP in - SIP out behind same public IP

Post by jwouters » Fri Sep 23, 2016 2:39 pm

I want to setup the following connection.
I have 2 sip devices setup in my home behind the same publlic IP.
One is a Grandstream 503 unit that has an FXO post.
When a call comes in on the FXO port I have the call forwarded to a SIP account on Sipsorcery
Second is a Gigaset 300A with handsets connected and a SIP line configured to Sipsorcery.
Please note that both devices are on the same public IP address

I want to have the incoming calls on the FXO port of the 503 go out to Sipsorcery and come back on the SIP trunk on the Gigaset to ring my handsets.

I have set a dialplan and I see the call coming in and executing the dial plan.
The dialplan line is:
when "device1" then sys.Dial ("device2@sipsorcery.com")
However it always ends up with "not available 480"

Can this be done? Can you please advice how this can be done?
Thanks in advance

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: SIP in - SIP out behind same public IP

Post by Aaron » Fri Sep 23, 2016 9:48 pm

Yes it should be possible. Even though your two SIP devices are behind the same public IP address they should end up on different ports.

Can you post the results of your Console trace (http://www.sipsorcery.com/mainsite/Help/Console) for the call attempt.

User avatar
jwouters
Posts: 5
Joined: Wed Jan 18, 2012 1:51 pm

Re: SIP in - SIP out behind same public IP

Post by jwouters » Tue Sep 27, 2016 8:08 am

Hello Aaron,

Here is the console trace of the call. Regards Jos Wouters

NATKeepAlive 08:03:59:347 sip1(5216): Requesting NAT keep-alive from proxy socket udp:67.222.131.147:5060 to udp:84.87.116.151:5060.
DialPlan 08:04:12:435 sip1(452): New call from udp:84.87.116.151:29873 successfully authenticated by digest.
DialPlan 08:04:12:482 sip1(452): Using dialplan VoxalotMigrated for Out call to sip:jospcthuis@sipsorcery.com:5060.
NewCall 08:04:12:513 sip1(452): Executing script dial plan for call to jospcthuis.
DialPlan 08:04:12:545 sip1(452): Outgoing call to jospcthuis.
DialPlan 08:04:12:545 sip1(452): Commencing Dial with: fritzbox@sipsorcery.com.
DialPlan 08:04:12:560 sip1(452): Call leg is for local domain forwarding to incoming dialplan for fritzbox@sipsorcery.com.
DialPlan 08:04:12:560 sip1(452): ForkCall commencing call leg to sip:fritzbox@sipsorcery.com.
DialPlan 08:04:12:560 sip1(452): Creating B2B call for sip:fritzbox@sipsorcery.com.
DialPlan 08:04:12:623 sip1(452): Using dialplan incoming for In call to sip:fritzbox@sipsorcery.com.
NewCall 08:04:12:654 sip1(452): Executing script dial plan for call to fritzbox.
DialPlan 08:04:12:669 sip1(452): Dialplan cleanup for jwouters.
DialPlan 08:04:13:153 sip1(452): Dial plan execution completed without answering and with no last failure status.
DialPlan 08:04:13:153 sip1(452): Call failed with a failure status of TemporarilyUnavailable and .
DialPlan 08:04:13:184 sip1(452): Dialplan cleanup for jwouters.
DialPlan 08:04:13:699 sip1(452): Dial plan execution completed without answering and a last failure status of TemporarilyUnavailable TemporarilyUnavailable.
DialPlan 08:04:13:699 sip1(452): Call failed with a failure status of TemporarilyUnavailable and TemporarilyUnavailable.
DialPlan 08:04:13:699 sip1(452): UAS call failed with a response status of 480 and TemporarilyUnavailable.

User avatar
jwouters
Posts: 5
Joined: Wed Jan 18, 2012 1:51 pm

Re: SIP in - SIP out behind same public IP

Post by jwouters » Tue Sep 27, 2016 8:11 am

Dial plan incoming

case req.URI.User
# inkomend gesprek van 085-xxxxxx via CallVoIP
# eerst 20 seconden naar Fritzbox dan naar Anveo URI met Call flow Keuze menu
# when "callvoip.incoming" then sys.Dial ("jwouters@sipsorcery.com")
when "callvoip.incoming" then sys.Dial ("31475475429@rebvoice|31475475429@EasyVoIP|31475475429@InterVoIP")
# when "callvoip.incoming" then sys.Dial ("josmobiel@sipsorcery.com")
# when "callvoip.incoming" then sys.Dial ("33787344629@EasyVoIP") # vakantienummer
# when "josmobiel" then sys.Dial ("josmobiel@sipsorcery.com")
# when "miekemobiel" then sys.Dial ("miekemobiel@sipsorcery.com")
# when "jostablet" then sys.Dial ("jostablet@sipsorcery.com")
when "jospcthuis" then sys.dial ("fritzboxs@sipsorcery.com")
# when "Anveo.incoming" then sys.dial ("fritzbox@sipsorcery.com")
# when "Anveo.incoming" then sys.Dial
# when "nakeuzemenu"
# val = req.Header.GetUnknownHeaderValue("toets")
# if val != nil
# case val
# when "1" then sys.Dial("josmobiel@sipsorcery.com")
# when "2" then sys.Dial("miekemobiel@sipsorcery.com")
# end
# end
end

Dial plan outgoing

if sys.Out

# ingesteld 26-04-2013
# Alles default routeren naar TerraSIP ter controle van spraak kwaliteit

# Outgoing Calls
sys.Log("Outgoing call to #{req.URI.User}.")

case req.URI.User

# Speed dials.

# Smart call rules.
# SIP naar SIP
when "miekemobiel" then sys.Dial ("miekemobiel@sipsorcery.com")
when "josmobiel" then sys.Dial ("josmobiel@sipsorcery.com")
when "jospcthuis" then sys.Dial ("fritzbox@sipsorcery.com")
when /^112/ then sys.Dial("${EXTEN}@callvoip") # NOOD NUMMER
when /^0800/ then sys.Dial("${EXTEN}@callvoip") # 0800 GRATIS nummers via VoIPcall
when /^00800/ then sys.Dial("${EXTEN}@callvoip") # 00800 INTERNATIONAL FREE PHONE nummers via VoIPcall
when /^0900/ then sys.Dial("${EXTEN}@callvoip") # 0900 BETAAL nummers via VoIPcall
when /^084/ then sys.Dial("${EXTEN}@callvoip") # 084 SERVICE nummers via VoIPcall
when /^087/ then sys.Dial("${EXTEN}@callvoip") # 087 SERVICE nummers via VoIPcall
when /^116/ then sys.Dial("${EXTEN}@VoIPcall") # INFO nummers via VoIPcall
when /^18/ then sys.Dial("${EXTEN}@callvoip") # INFO nummers via VoIPcall

# Mobiel met 31 ervoor: 1. Rebvoice 2. InterVoIP 3. EasyVoIP 4. VoIPAlot gebaseerd op tarief € 0,023 - € 0,035 - € 0,044 - € 0,052
when /^316/ then sys.Dial("${EXTEN}@rebvoice|${EXTEN}@InterVoIP|${EXTEN}@EasyVoIP|${EXTEN}@VoIPAlot|${EXTEN}@callvoip") # MOBIEL met 31 ervoor
# Mobiel zonder +31 ervoor: 1. Rebvoice 2. InterVoIP 3. EasyVoIP 4. VoIPAlot gebaseerd op tarief € 0,023 - € 0,035 - € 0,044 - € 0,052
when /^06/ then sys.Dial("31${EXTEN:1}@rebvoice|31${EXTEN:1}@InterVoIP|31${EXTEN:1}@EasyVoIP|31${EXTEN:1}@VoIPAlot|31${EXTEN:1}@callvoip") # MOBIEL zonder 31 ervoor
# Mobiel met +31 ervoor: 1. Rebvoice 2. InterVoIP 3. EasyVoIP 4. VoIPAlot gebaseerd op tarief € 0,023 - € 0,035 - € 0,044 - € 0,052
when /^\+316/ then sys.Dial("${EXTEN:1}@rebvoice|${EXTEN:1}@InterVoIP|${EXTEN:1}@EasyVoIP|${EXTEN:1}@VoIPAlot|${EXTEN:1}@callvoip") # MOBIEL met +31 ervoor
# Vast net nummers in Nederland met +31 ervoor: 1. rebvoice. VoIPAlot 3. InterVoIP gebaseerd op tarief € 0,0044 - € 0,005 - € 0,017
when /^\+31[1-57-9]/ then sys.Dial("${EXTEN:1}@rebvoice|${EXTEN:1}@EasyVoIP|${EXTEN:1}@VoIPAlot|${EXTEN:1}@InterVoIP|${EXTEN:1}@callvoip") # NATIONAAL
# Vast net nummers in Nederland: 1. rebvoice 2. EasyVoIP 3. InterVoIP gebaseerd op tarief € 0,0044 - € 0,005 - € 0,017
when /^0[1-57-9][0-9]{8}$/ then sys.Dial("31${EXTEN:1}@rebvoice|31${EXTEN:1}@EasyVoIP|31${EXTEN:1}@VoIPAlot|31${EXTEN:1}@InterVoIP|31${EXTEN:1}@callvoip") # NATIONAAL
# Vast net nummers in 0475: 1. VoIPAlot 2. EasyVoIP 3. InterVoIP gebaseerd op tarief € 0,0044 - € 0,005 - € 0,017
when /^[1-9][0-9]{5}$/ then sys.Dial("31475${EXTEN}@rebvoice|31475${EXTEN}@EasyVoIP|31475${EXTEN}@VoIPAlot|31475${EXTEN}@InterVoIP|31475${EXTEN}@callvoip") # LOKAAL
# Gemeente nummers 1. EasyVoIP 2. VoIPAlot 3. InterVoIP
when /^14/ then sys.Dial("31${EXTEN}@VoIPAlot|31${EXTEN}@EasyVoIP|31${EXTEN}@rebvoice|31${EXTEN}@InterVoIP|31${EXTEN}@callvoip") # gemeentenummers
# Internationaal met +31 ervoor: 1. VoIPAlot 2. EasyVoIP 3. InterVoIP gebaseerd op tarief € 0,0044 voor België, Duitsland en UK
when /^\+/ then sys.Dial("${EXTEN:1}@rebvoice|${EXTEN:1}@VoIPAlot|${EXTEN:1}@EasyVoIP|${EXTEN:1}@InterVoIP|${EXTEN:1}@callvoip") # INTERNATIONAAL alles van mobiel
# Internationaal met 00 ervoor: 1. VoIPAlot 2. EasyVoIP 3. InterVoIP gebaseerd op tarief € 0,0044 voor België, Duitsland en UK
when /^00/ then sys.Dial("${EXTEN:2}@rebvoice|${EXTEN:2}@VoIPAlot|${EXTEN:2}@EasyVoIP|${EXTEN:2}@InterVoIP") # INTERNATIONAAL alles van vast
else sys.Log("No matching rule found for outgoing call to #{req.URI.User}.")
end
end

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: SIP in - SIP out behind same public IP

Post by Aaron » Wed Sep 28, 2016 10:25 am

Do you need an incoming dialplan set on your fritzbox SIP account?

When you forward a call to fritzbox from VoxalotMigrated it then invokes a second dialplan instance and that dialplan doesn't seem to be finding anything to do with the call.

If you remove the incoming dialplan setting from the fritzbox SIP account it will use the simple drfault behavior of forwarding to the fritzbox@sipsorcery.com registered contacts.

User avatar
jwouters
Posts: 5
Joined: Wed Jan 18, 2012 1:51 pm

Re: SIP in - SIP out behind same public IP

Post by jwouters » Thu Oct 13, 2016 12:01 pm

Hi Aaron,

I've got things working , but I only have one side voice.
Can speak from phone 1 to 2, but not back from 2 to 1.
Any advise how I can solve this?

Regards

Jos Wouters

Post Reply