Re: [asterisk-users] TCP dial via proxy
Hi Łukasz, A TCP call works fine under normal circumstances. It's just when we send the call via a proxy that we have a problem, because the call to the proxy doesn't appear to use TCP. Thank you. On Fri, 22 Jul 2022 at 11:58, Łukasz Grzywański wrote: > Hi, > which version are you using ? > please show: asterisk -rx "sip show peer sip-peer" > > I checked... > I use UDP and TCP, my phone via UDP, telekom via TCP and works > > > same => n,dial(SIP/${EXTEN}@sip-trunk-telekom) > > [image: image.png] > > > On Thu, 21 Jul 2022 at 23:58, David Cunningham > wrote: > >> Thank you Thomas. I know it would be good to move to pjsip, and that's >> coming in a future product version, but it isn't used in the version of >> this scenario. >> >> >> On Fri, 22 Jul 2022 at 01:30, Thomas Ray >> wrote: >> >>> The answer is chan_pjsip. You can do this with chan_pjsip. There’s no >>> real support for chan_sip anymore. It’s dead, it’s going away. No fixes or >>> updates will be accepted against it as of this point. >>> >>> >>> >>> *From: *asterisk-users on >>> behalf of Dovid Bender >>> *Reply-To: *Asterisk Users Mailing List - Non-Commercial Discussion < >>> asterisk-users@lists.digium.com> >>> *Date: *Thursday, July 21, 2022 at 9:21 AM >>> *To: *Asterisk Users Mailing List - Non-Commercial Discussion < >>> asterisk-users@lists.digium.com> >>> *Subject: *Re: [asterisk-users] TCP dial via proxy >>> >>> >>> >>> David, >>> >>> >>> >>> We had this exact "issue" in the past and were not able to figure out >>> how to do it. Where we wanted tcp we prefixed the sip URI with "force_tcp". >>> So: >>> >>> Dial(SIP/1234@1.1.1.1//2.2.2.2 <http://1234@1.1.1.1/2.2.2.2>) >>> >>> became: >>> >>> Dial(SIP/force_tcp1234@1.1.1.1//2.2.2.2 >>> <http://force_tcp1234@1.1.1.1/2.2.2.2>) >>> >>> On Kamailio's side in the FORWARD block we added: >>> >>> # HACK for forcing TCP >>> if ($oU != $null && $(oU{s.len}) != 0) { >>> $var(prefix) = $(oU{s.substr,0,9}); >>> if ($var(prefix) == "force_tcp") { >>> $rU = $(oU{s.substr,9,0}); >>> add_uri_param( "transport=tcp" ); >>> $fs = "tcp:" + $Ri + ":5060"; >>> } >>> } >>> >>> >>> >>> >>> >>> >>> >>> On Wed, Jul 20, 2022 at 10:47 PM David Cunningham < >>> dcunning...@voisonics.com> wrote: >>> >>> Hello, >>> >>> >>> >>> We have an Asterisk dial which sends the call via a proxy using //, for >>> example: >>> >>> >>> >>> Dial(SIP/${EXTEN}@peer_address//proxy_address) >>> >>> >>> >>> Does anyone know how we can make the SIP to the proxy use TCP? We tried >>> making proxy_address match a peer in sip.conf with "transport = tcp" but >>> that didn't seem to work. We are using chan_sip. >>> >>> >>> >>> Thanks very much for any advice. >>> >>> >>> >>> -- >>> >>> David Cunningham, Voisonics Limited >>> http://voisonics.com/ >>> USA: +1 213 221 1092 >>> New Zealand: +64 (0)28 2558 3782 >>> >>> -- >>> _ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> Check out the new Asterisk community forum at: >>> https://community.asterisk.org/ >>> >>> New to Asterisk? Start here: >>> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>>http://lists.digium.com/mailman/listinfo/asterisk-users >>> >>> -- _ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> Check out the new Asterisk community forum at: >>> https://community.asterisk.org/ New to Asterisk? Start here: >>> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >>> asterisk-users mailing
Re: [asterisk-users] TCP dial via proxy
Hi, which version are you using ? please show: asterisk -rx "sip show peer sip-peer" I checked... I use UDP and TCP, my phone via UDP, telekom via TCP and works same => n,dial(SIP/${EXTEN}@sip-trunk-telekom) [image: image.png] On Thu, 21 Jul 2022 at 23:58, David Cunningham wrote: > Thank you Thomas. I know it would be good to move to pjsip, and that's > coming in a future product version, but it isn't used in the version of > this scenario. > > > On Fri, 22 Jul 2022 at 01:30, Thomas Ray wrote: > >> The answer is chan_pjsip. You can do this with chan_pjsip. There’s no >> real support for chan_sip anymore. It’s dead, it’s going away. No fixes or >> updates will be accepted against it as of this point. >> >> >> >> *From: *asterisk-users on >> behalf of Dovid Bender >> *Reply-To: *Asterisk Users Mailing List - Non-Commercial Discussion < >> asterisk-users@lists.digium.com> >> *Date: *Thursday, July 21, 2022 at 9:21 AM >> *To: *Asterisk Users Mailing List - Non-Commercial Discussion < >> asterisk-users@lists.digium.com> >> *Subject: *Re: [asterisk-users] TCP dial via proxy >> >> >> >> David, >> >> >> >> We had this exact "issue" in the past and were not able to figure out how >> to do it. Where we wanted tcp we prefixed the sip URI with "force_tcp". So: >> >> Dial(SIP/1234@1.1.1.1//2.2.2.2 <http://1234@1.1.1.1/2.2.2.2>) >> >> became: >> >> Dial(SIP/force_tcp1234@1.1.1.1//2.2.2.2 >> <http://force_tcp1234@1.1.1.1/2.2.2.2>) >> >> On Kamailio's side in the FORWARD block we added: >> >> # HACK for forcing TCP >> if ($oU != $null && $(oU{s.len}) != 0) { >> $var(prefix) = $(oU{s.substr,0,9}); >> if ($var(prefix) == "force_tcp") { >> $rU = $(oU{s.substr,9,0}); >> add_uri_param( "transport=tcp" ); >> $fs = "tcp:" + $Ri + ":5060"; >> } >> } >> >> >> >> >> >> >> >> On Wed, Jul 20, 2022 at 10:47 PM David Cunningham < >> dcunning...@voisonics.com> wrote: >> >> Hello, >> >> >> >> We have an Asterisk dial which sends the call via a proxy using //, for >> example: >> >> >> >> Dial(SIP/${EXTEN}@peer_address//proxy_address) >> >> >> >> Does anyone know how we can make the SIP to the proxy use TCP? We tried >> making proxy_address match a peer in sip.conf with "transport = tcp" but >> that didn't seem to work. We are using chan_sip. >> >> >> >> Thanks very much for any advice. >> >> >> >> -- >> >> David Cunningham, Voisonics Limited >> http://voisonics.com/ >> USA: +1 213 221 1092 >> New Zealand: +64 (0)28 2558 3782 >> >> -- >> _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >>http://lists.digium.com/mailman/listinfo/asterisk-users >> >> -- _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> asterisk-users mailing list To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users >> -- >> _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >>http://lists.digium.com/mailman/listinfo/asterisk-users > > > > -- > David Cunningham, Voisonics Limited > http://voisonics.com/ > USA: +1 213 221 1092 >
Re: [asterisk-users] TCP dial via proxy
Thank you Thomas. I know it would be good to move to pjsip, and that's coming in a future product version, but it isn't used in the version of this scenario. On Fri, 22 Jul 2022 at 01:30, Thomas Ray wrote: > The answer is chan_pjsip. You can do this with chan_pjsip. There’s no real > support for chan_sip anymore. It’s dead, it’s going away. No fixes or > updates will be accepted against it as of this point. > > > > *From: *asterisk-users on > behalf of Dovid Bender > *Reply-To: *Asterisk Users Mailing List - Non-Commercial Discussion < > asterisk-users@lists.digium.com> > *Date: *Thursday, July 21, 2022 at 9:21 AM > *To: *Asterisk Users Mailing List - Non-Commercial Discussion < > asterisk-users@lists.digium.com> > *Subject: *Re: [asterisk-users] TCP dial via proxy > > > > David, > > > > We had this exact "issue" in the past and were not able to figure out how > to do it. Where we wanted tcp we prefixed the sip URI with "force_tcp". So: > > Dial(SIP/1234@1.1.1.1//2.2.2.2 <http://1234@1.1.1.1/2.2.2.2>) > > became: > > Dial(SIP/force_tcp1234@1.1.1.1//2.2.2.2 > <http://force_tcp1234@1.1.1.1/2.2.2.2>) > > On Kamailio's side in the FORWARD block we added: > > # HACK for forcing TCP > if ($oU != $null && $(oU{s.len}) != 0) { > $var(prefix) = $(oU{s.substr,0,9}); > if ($var(prefix) == "force_tcp") { > $rU = $(oU{s.substr,9,0}); > add_uri_param( "transport=tcp" ); > $fs = "tcp:" + $Ri + ":5060"; > } > } > > > > > > > > On Wed, Jul 20, 2022 at 10:47 PM David Cunningham < > dcunning...@voisonics.com> wrote: > > Hello, > > > > We have an Asterisk dial which sends the call via a proxy using //, for > example: > > > > Dial(SIP/${EXTEN}@peer_address//proxy_address) > > > > Does anyone know how we can make the SIP to the proxy use TCP? We tried > making proxy_address match a peer in sip.conf with "transport = tcp" but > that didn't seem to work. We are using chan_sip. > > > > Thanks very much for any advice. > > > > -- > > David Cunningham, Voisonics Limited > http://voisonics.com/ > USA: +1 213 221 1092 > New Zealand: +64 (0)28 2558 3782 > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users > > -- _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > Check out the new Asterisk community forum at: > https://community.asterisk.org/ New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users > mailing list To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- David Cunningham, Voisonics Limited http://voisonics.com/ USA: +1 213 221 1092 New Zealand: +64 (0)28 2558 3782 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] TCP dial via proxy
Hi Dovid, Thanks for the reply. We are indeed able to force TCP from the Kamailio proxy, but haven't been able to force it between Asterisk and Kamailio. On Fri, 22 Jul 2022 at 01:21, Dovid Bender wrote: > David, > > We had this exact "issue" in the past and were not able to figure out how > to do it. Where we wanted tcp we prefixed the sip URI with "force_tcp". So: > Dial(SIP/1234@1.1.1.1//2.2.2.2) > became: > Dial(SIP/force_tcp1234@1.1.1.1//2.2.2.2) > On Kamailio's side in the FORWARD block we added: > # HACK for forcing TCP > if ($oU != $null && $(oU{s.len}) != 0) { > $var(prefix) = $(oU{s.substr,0,9}); > if ($var(prefix) == "force_tcp") { > $rU = $(oU{s.substr,9,0}); > add_uri_param( "transport=tcp" ); > $fs = "tcp:" + $Ri + ":5060"; > } > } > > > > On Wed, Jul 20, 2022 at 10:47 PM David Cunningham < > dcunning...@voisonics.com> wrote: > >> Hello, >> >> We have an Asterisk dial which sends the call via a proxy using //, for >> example: >> >> Dial(SIP/${EXTEN}@peer_address//proxy_address) >> >> Does anyone know how we can make the SIP to the proxy use TCP? We tried >> making proxy_address match a peer in sip.conf with "transport = tcp" but >> that didn't seem to work. We are using chan_sip. >> >> Thanks very much for any advice. >> >> -- >> David Cunningham, Voisonics Limited >> http://voisonics.com/ >> USA: +1 213 221 1092 >> New Zealand: +64 (0)28 2558 3782 >> -- >> _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >>http://lists.digium.com/mailman/listinfo/asterisk-users > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- David Cunningham, Voisonics Limited http://voisonics.com/ USA: +1 213 221 1092 New Zealand: +64 (0)28 2558 3782 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] TCP dial via proxy
Hi Henning, We tried using outboundproxy as follows, but the SIP from Asterisk to the proxy still went via UDP. Is there anything else you'd suggest? Thank you. In extensions.conf: Dial(SIP/${EXTEN}@sip-peer) In sip.conf: [general] tcpenable = yes tcpbindaddr = 0.0.0.0 [sip-peer] host = final.destination.com transport = tcp outboundproxy = our.proxy.com On Fri, 22 Jul 2022 at 01:23, Henning Follmann wrote: > On Thu, Jul 21, 2022 at 02:46:07PM +1200, David Cunningham wrote: > > Hello, > > > > We have an Asterisk dial which sends the call via a proxy using //, for > > example: > > > > Dial(SIP/${EXTEN}@peer_address//proxy_address) > > > > Does anyone know how we can make the SIP to the proxy use TCP? We tried > > making proxy_address match a peer in sip.conf with "transport = tcp" but > > that didn't seem to work. We are using chan_sip. > > > > Thanks very much for any advice. > > > > Have you tried to define > outboundproxy=proxy_address > in your sip.conf? > > -H > > > > -- > Henning Follmann | hfollm...@itcfollmann.com > > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- David Cunningham, Voisonics Limited http://voisonics.com/ USA: +1 213 221 1092 New Zealand: +64 (0)28 2558 3782 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] TCP dial via proxy
The answer is chan_pjsip. You can do this with chan_pjsip. There’s no real support for chan_sip anymore. It’s dead, it’s going away. No fixes or updates will be accepted against it as of this point. From: asterisk-users on behalf of Dovid Bender Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion Date: Thursday, July 21, 2022 at 9:21 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] TCP dial via proxy David, We had this exact "issue" in the past and were not able to figure out how to do it. Where we wanted tcp we prefixed the sip URI with "force_tcp". So: Dial(SIP/1234@1.1.1.1//2.2.2.2) became: Dial(SIP/force_tcp1234@1.1.1.1//2.2.2.2) On Kamailio's side in the FORWARD block we added: # HACK for forcing TCP if ($oU != $null && $(oU{s.len}) != 0) { $var(prefix) = $(oU{s.substr,0,9}); if ($var(prefix) == "force_tcp") { $rU = $(oU{s.substr,9,0}); add_uri_param( "transport=tcp" ); $fs = "tcp:" + $Ri + ":5060"; } } On Wed, Jul 20, 2022 at 10:47 PM David Cunningham wrote: Hello, We have an Asterisk dial which sends the call via a proxy using //, for example: Dial(SIP/${EXTEN}@peer_address//proxy_address) Does anyone know how we can make the SIP to the proxy use TCP? We tried making proxy_address match a peer in sip.conf with "transport = tcp" but that didn't seem to work. We are using chan_sip. Thanks very much for any advice. -- David Cunningham, Voisonics Limited http://voisonics.com/ USA: +1 213 221 1092 New Zealand: +64 (0)28 2558 3782 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] TCP dial via proxy
On Thu, Jul 21, 2022 at 02:46:07PM +1200, David Cunningham wrote: > Hello, > > We have an Asterisk dial which sends the call via a proxy using //, for > example: > > Dial(SIP/${EXTEN}@peer_address//proxy_address) > > Does anyone know how we can make the SIP to the proxy use TCP? We tried > making proxy_address match a peer in sip.conf with "transport = tcp" but > that didn't seem to work. We are using chan_sip. > > Thanks very much for any advice. > Have you tried to define outboundproxy=proxy_address in your sip.conf? -H -- Henning Follmann | hfollm...@itcfollmann.com -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] TCP dial via proxy
David, We had this exact "issue" in the past and were not able to figure out how to do it. Where we wanted tcp we prefixed the sip URI with "force_tcp". So: Dial(SIP/1234@1.1.1.1//2.2.2.2) became: Dial(SIP/force_tcp1234@1.1.1.1//2.2.2.2) On Kamailio's side in the FORWARD block we added: # HACK for forcing TCP if ($oU != $null && $(oU{s.len}) != 0) { $var(prefix) = $(oU{s.substr,0,9}); if ($var(prefix) == "force_tcp") { $rU = $(oU{s.substr,9,0}); add_uri_param( "transport=tcp" ); $fs = "tcp:" + $Ri + ":5060"; } } On Wed, Jul 20, 2022 at 10:47 PM David Cunningham wrote: > Hello, > > We have an Asterisk dial which sends the call via a proxy using //, for > example: > > Dial(SIP/${EXTEN}@peer_address//proxy_address) > > Does anyone know how we can make the SIP to the proxy use TCP? We tried > making proxy_address match a peer in sip.conf with "transport = tcp" but > that didn't seem to work. We are using chan_sip. > > Thanks very much for any advice. > > -- > David Cunningham, Voisonics Limited > http://voisonics.com/ > USA: +1 213 221 1092 > New Zealand: +64 (0)28 2558 3782 > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] TCP dial via proxy
Hello, We have an Asterisk dial which sends the call via a proxy using //, for example: Dial(SIP/${EXTEN}@peer_address//proxy_address) Does anyone know how we can make the SIP to the proxy use TCP? We tried making proxy_address match a peer in sip.conf with "transport = tcp" but that didn't seem to work. We are using chan_sip. Thanks very much for any advice. -- David Cunningham, Voisonics Limited http://voisonics.com/ USA: +1 213 221 1092 New Zealand: +64 (0)28 2558 3782 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users