Dear Community,
I have a need of communicating with other servers using private IP with
private IP in Via and SDP connection information but at same time sometime
need connect to public IP SIP server and on outgoing INVITE's i need
advertise public IP in Record-Route and SDP Connection information.
Currently if i work on listen=udp:privateip:5060 i get working the LAN part
but cannot work over internet (no audio) but when i add advertise i get SDP
public IP also over local network.
Is it possible to solve this case using one NIC adapter?
I am using RTPProxy.
Please help me out. I tried to add second network adapter with advertise
and mhomed=1 something started to work but i think i would need work on the
call direction and different rtpproxy_manage handling on outside INVITEs
and incoming 200 OK responses.
I am not sure if this is the right way to do it - maybe there is some
easier method of achieving what i need using one interface ?
Best regards,
Tom
Hey guys,
I'm trying to do a replacement regex using subst_hf but I can't seem to get
the format right and the docs are confusing.
*subst_hf: *docs say it uses perl-like regex (as I understand it, that
would mean PCRE). Docs also say in the 'subexp' param that it uses the same
format as *subst.*
*subst: *at the beginning it says it uses perl or sed format, but in the
'/re/repl/flags' param it says that sed format.
https://www.kamailio.org/docs/modules/devel/modules/textops.html#textops.f.…
4.20. subst_hf(hf, subexp, flags)
Perl-like substitutions in the body of a header field.
Meaning of the parameters is as follows:
-
*hf* - header field name.
-
*subexp* - substitution expression in the same format as of the 'subst'
function parameter.
-
*flags* - control flags - it has to be one of: a - all headers matching
the name; f - only first header matching the name; l - only the last header
matching the name.
4.16. subst('/re/repl/flags')
Replaces re with repl (sed or perl like).
Meaning of the parameters is as follows:
-
*'/re/repl/flags'* - sed like regular expression. flags can be a
combination of i (case insensitive), g (global) or s (match newline don't
treat it as end of line).
're' - is regular expression
'repl' - is replacement string - may contain pseudo-variables
'flags' - substitution flags (i - ignore case, g - global)
I'm trying to use this:
subst_hf("X-myheader", "/^(?!string1 |example2-|text3 )(.*)/myprefix \1/",
"a")
In an online tester using PCRE, the format is correct, but Kamailio doesn't
like it:
Oct 4 09:29:16 cops-n1 cops[15957]: ERROR: <core> [core/re.c:285]:
subst_parser(): bad regular expression ^(?!string1 |example2-|text3 )(.*)
in /^(?!string1 |example2-|text3 )(.*)/myprefix \1/
If I remove the negative lookahead chars (?!) then kamailio doesn't
complain but the regex doesn't do what I want.
Does this mean that Kamailio won't support negative lookahead for subst
regex replacements?
What I'm trying to achieve is something along:
"If the value of the header Myheader doesn't start with ABC, DEF or HIJ,
then prefix it with XYZ"
Any suggestions/ideas on how to achieve this?
Thanks,
Joel.
I am having some difficulties with the seas module under Kam 5.5.2. If my application server is not connected then the config file script below never returns
if (!as_relay_t ("myserver")) {
Xlog ("LM_NOTICE", "myserver not connected\n");
}
A diagnostic in the "seas.c" file does report that the app server is not connected, but the one above is never printed. Any help here would be appreciated.
This email is intended only for the use of the party to which it is addressed and may contain information that is privileged, confidential, or protected by law. If you are not the intended recipient you are hereby notified that any dissemination, copying or distribution of this email or its contents is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer.
Hello all,
I'm new to Kamailio, so bear with me as I stumble through this. First, I'll describe what I'm trying to achieve at a high level and then perhaps somebody can advise me on whether Kamailio is a good fit for this solution or not. I'd like to be able to deploy a small appliance type server to our customer's sites that just runs Kamailio and a VPN connection back to our datacenter. At our datacenter, we run virtualized instances of Asterisk for each of our customers. The idea is that Kamailio would act as a transparent proxy through to the Asterisk instance under nominal conditions and as a basic SIP router in the case that the Asterisk instance is unavailable. This degraded functionality would then at least allow extension to extension calling even if the Internet or Asterisk instance is down.
I'm currently using dispatcher with a single entry in preparation for a time when we might want to failover to another Asterisk instance. I'm forwarding all REGISTER and INVITE messages to the server chosen from ds_select_dst. Initially this all seems to work as I can register with a softphone and pjsip show endpoints shows my softphone connected. However, when I attempt to call any extension (my own or another) Asterisk responds to the INVITE message with a "401 Unauthorized" message and the typical "The person at extension XXXX is unavailable...".
I know that more details might be necessary to troubleshoot this, but I didn't want to include everything in one post and risk cluttering it up with unnecessary information. If anyone can confirm that this is a reasonable way to approach the problem, I can then provide whatever relevant data is necessary to get deeper into it. (I've used sngrep, logging, asterisk cli, etc.)
Thanks in advance for any help.
Dear,
I am testing the kakamilio 4.4 with rtpproxy on Debian stretch 9.13
I have installed the packages
- apt-get install kamailio and rtpproxy.
- kamailio 4.4
- rtpproxy Basic version: 20040107
*My version of RTPPROXY doesn't have the -A parameter so that means without
advertising there is no way to work behind NAT? That is what I have
understood after spending one week on forums. Thanks if somebody could
confirm otherwise, which way I need to go to figure out my issue?*
# rtpproxy -v
> Basic version: 20040107
> Extension 20050322: Support for multiple RTP streams and MOH
> Extension 20060704: Support for extra parameter in the V command
> Extension 20071116: Support for RTP re-packetization
> Extension 20071218: Support for forking (copying) RTP stream
> Extension 20080403: Support for RTP statistics querying
> Extension 20081102: Support for setting codecs in the update/lookup command
> Extension 20081224: Support for session timeout notifications
>
> # rtpproxy -help
> rtpproxy: invalid option -- 'h'
> usage: rtpproxy [-2fvFiPa] [-l addr1[/addr2]] [-6 addr1[/addr2]] [-s path]
> [-t tos] [-r rdir [-S sdir]] [-T ttl] [-L nfiles] [-m port_min]
> [-M port_max] [-u uname[:gname]] [-n timeout_socket] [-d
> log_level[:log_facility]]
> #
>
/etc/hosts
127.0.0.1 localhost
> 127.0.1.1 sip.dom.xx sip
> 192.168.1.19 sip.dom.xx sip
> PUBLIC_IP sip.dom.xx sip
> # The following lines are desirable for IPv6 capable hosts
> ::1 localhost ip6-localhost ip6-loopback
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
>
*/etc/kamailio/kamailio.cfg*
kamailio.config
> #!define PUBLIC_IP "xxx.xxx.xxx.xxx"
> #!define PRIVATE_IP "192.168.1.19"
> #!define PRIVATE_NET "192.168.1.0/24“
>
listen=udp:PRIVATE_IP:5060 advertise PUBLIC_IP:5060
>
>
#!ifdef WITH_NAT
>
> # ----- rtpproxy params -----
>
> modparam("rtpproxy", "rtpproxy_sock", "udp:PRIVATE_IP:7722")
>
>
> # ----- nathelper params -----
>
> modparam("nathelper", "natping_interval", 30)
>
> modparam("nathelper", "ping_nated_only", 1)
>
> modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
>
> modparam("nathelper", "sipping_from", "sip:pinger@kamailio.org")
>
*Etc/default/rtpproxy*
PRIVATE_IP=192.168.1.19
>
> PUBLIC_IP=xxx.xxx.xxx.xxx
>
> rtpport_min= 10000
>
> rtpport_max=20000
>
> syslog=DBUG:LOG_LOCAL5
>
> #Defaults for rtpproxy
> #The control socket.
> #CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
> #To listen on an UDP socket, uncomment this line:
> #CONTROL_SOCK=udp:127.0.0.1:7722
> #Additional options that are passed to the daemon.
> EXTRA_OPTS="-l $PRIVATE_IP/$PUBLIC_IP ="-s $PRIVATE_IP:7222 -m $
> rtpport_min -M $rtpport_max -d $syslog"`
>
Thanks if you could route me to the right way.
Best regards
Yboujraf
Email: yboujraf(a)gmail.com
Hello!
Is there any method of querying presence (dialog) state for particular
endpoint from config file other than that direct query to presence tables
in database?
Idea is to reflect server-side DND state as "confirmed" (talking) , so I
need to skip certain PUBLISH messages not to reset this state.
--
Best regards,
Igor
Dear
Thanks for your quick reply and sorry for spamming your mailbox.
I am very confused about the setup of kamailio.cfg and rtpproxy.
I have an existing kamailio 4.4 - rtpproxy running and I get the config
files from both and setup the new vm.
Just private connection works but the idea is to have connection from
outside too.
I am sure there is a mismatch with public ip, natting and/or setup of the
vm hosts file.
- architecture:
*- 1x virtualbox*
+ 1x vm with bridge mode for network (get private ip address from the
router). I suppose this is the PRIVATE_IP
*+ 1x desktop (windows)* hosting a sipphone here Microsip (
https://www.microsip.org/)
*- 1x modem/router* from the telecom provider - bbox-3V+ from PROXIMUS
+ forced in DMZ host the Kamailio server PRIVATE_IP
[image: 211001 - kamailio architecture and settings.png]
- the hosts file from Kamailio + rtpproxy is ( Maybe something is wrong
or missing)
/etc/hosts
127.0.0.1 localhost
> 127.0.1.1 sipsecure.by-systems.be sipsecure
> 192.168.1.19 sipsecure.by-systems.be sipsecure
> xxx.XXX.xxx.XXX sipsecure.by-systems.be sipsecure
> # The following lines are desirable for IPv6 capable hosts
> ::1 localhost ip6-localhost ip6-loopback
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
>
*/etc/kamailio/kamailio.cfg*
kamailio.config
> #!define PUBLIC_IP "xxx.xxx.xxx.xxx"
> #!define PRIVATE_IP "192.168.1.19"
> #!define PRIVATE_NET "192.168.1.0/24“
>
> #!ifdef WITH_NAT
>
> # ----- rtpproxy params -----
>
> modparam("rtpproxy", "rtpproxy_sock", "udp:PRIVATE_IP:7722")
>
>
> # ----- nathelper params -----
>
> modparam("nathelper", "natping_interval", 30)
>
> modparam("nathelper", "ping_nated_only", 1)
>
> modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
>
> modparam("nathelper", "sipping_from", "sip:pinger@kamailio.org")
>
*Etc/default/rtpproxy*
PRIVATE_IP=192.168.1.19
>
> PUBLIC_IP=xxx.xxx.xxx.xxx
>
> rtpport_min= 10000
>
> rtpport_max=20000
>
> syslog=DBUG:LOG_LOCAL5
>
> #Defaults for rtpproxy
> #The control socket.
> #CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
> #To listen on an UDP socket, uncomment this line:
> #CONTROL_SOCK=udp:127.0.0.1:7722
> #Additional options that are passed to the daemon.
> EXTRA_OPTS="-l $PRIVATE_IP/$PUBLIC_IP ="-s $PRIVATE_IP:7222 -m $
> rtpport_min -M $rtpport_max -d $syslog"`
>
- *Misconfiguring the VM*
That means do I need to use setup 1 or 2 or another
1. 2x NIC interfaces (one with private ip, second from dmz ip + NAT1:1
public ip)
2. 1x NIC interface (one private ip and natted 1:1 with public address)
- *test*
1. *use case 1 : *connect two (2x) sipphone from private network
(included kamailio) = OK
2. *use case 2 :* connect one (1x) codec from private ip and one (1x)
codec from public network (like mobile) = = issue - disconnect after 30 s
(register expires) start a conversation with audio but the caller or the
callee continues to send and INVITE message.
3. *use case 3 :* connect two (2x) sipphone from public network = issue
- disconnect after 30 s (register expires) start a conversation with audio
but the caller or the callee continue to send an INVITE message.
Best Regards,
Youssef BOUJRAF