Hi,
I am trying the following:
- extract the message body
- replace some content
- store it in a hashtable
- send it out in a reply in later request
I do the following:
[...]
$sht(sdp=>$ci) = $(rb{s.replace,a=sendrecv,a=sendrecv\\r\\na=curr:qos local
none});
[...]
set_reply_body("$sht(sdp=>$ci)", "application/sdp");
send_reply("200", "OK");
[...]
It works like a charm, however I'm facing one small issue:
My SDP looks like this:
[...]
a=rtpmap:8 PCMA/8000
a=sendrecv\r\na=curr:qos local none
a=rtcp:34949
[...]
It seems that s.replace is escaping characters.
Anyone any ideas?
Thanks,
Carsten
$var(x) = "abababa";
$(var(x){s.replace,a,c} => "cbcbcbc"
--
Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany
T +49 40 524 75 93-40 | M +49 179 2021244 I www.ng-voice.com
Registry Office at Local Court Hamburg, HRB 120189
Managing Directors: Dr. David Bachmann, Carsten Bock
Hello,
another topic discussed during the online devel meeting last week was
about what kind of announcements should be allowed on this list.
The purpose of sr-users list is to be an open community forum to help
each other to install, configure and operate Kamailio instances.
So far we announced here any new Kamailio versions (obvious) as well as
releases to the open source (and free) applications/tools strictly
developed for Kamailio (the kamcli and siremis), plus the events related
to Kamailio community or project development. Last I am aware of being
"accepted" to be announced on this list is the availability to hire
Kamailio experts or to be hired, relying on common sense and not abuse
of sending often such announcements (which happened so far).
Now it came into discussions if announcements about other applications
or projects that are built with Kamailio or useful for
building/operating Kamailio-based services. Becoming aware of such
things can be very valuable for the community, but because this may be
interpreted differently (what's useful for me, might not be for others),
we should be careful and set the rules to avoid "polluting/spamming"
this group of discussions.
On the online meeting was somehow considered acceptable to have one time
announcement when launching such a project. Clearly this is not the
place for announcing every new featured added in external projects or
their releases. Moreover, the projects have to be related from real time
communications perspective, like:
- the project/application is built on top of kamailio (e.g., pbx
system with kamailio inside and web ui)
- completes what kamailio can do or needs for real time communication
services (e.g., monitoring the sip/rtp traffic, billing/charging of sip
calls, sip softphone, lib or media server ...)
Again, only if these projects/applications are open source and free to
use, plus the announcement only when launching the project (or better
said, at the moment of the first usable version). Posts to this mailing
lists can be done only by members, so who sends the announcement has to
be part of the community.
If people find it acceptable to get such announcements, I would also
consider to revise the policy if we start having more than 2-3 such
announcements per month.
So, the question for now is if people here would find in useful to have
such announcements. Let's see what arguments are for one or the other
variant and get to conclusion good for most of us.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Hi everyone
I'm trying to implement OpenSIPS-like mid registrar functionality using UAC
module
Up to now, I was simply performing authentication on my kamailio instance,
saving to local domain and forwarding the request to another proxy
I'd like to lower the number of requests sent to this other proxy, by
forwarding only a few of the incoming requests. This is not a problem to
do, but then comes the handling of expiration. If the SIP UAC is
disconnected, the registration expires on my kamailio instance, but I don't
know how to correctly notify the other proxy on the unregistration (I was
trying to build and send a request using uac_send_req(), but this is
useless as I can't set the CSeq value)
While looking for a solution to my problem, I discovered that OpenSIPS had
a mid registrar module doing exactly what I'd like to do (according to the
documentation at least). I also saw old messages on this list that it was
possible to achieve the same result with UAC module on kamailio
In particular, I don't see why (or if) I need to populate the uacreg table.
I don't see why it should be necessary, and it would have a great impact on
performance to use a db for this matter. I also don't need (I think) to
have different local and remote from and to URIs
I think I need to build the a new REGISTER request using $uac_req, but I
don't see any contact header in the outgoing request, despite having set
reg_contact_addr value
Thanks for any clue you could give me
I’ve been missing with this for a while and seem to be missing something. Any suggestions on what is missing here?
Trying to use set_contact_alias() and handle_ruri_alias() from nathelper module and nat_keepalive from nat_traversal module, without registrar.
I had register keepalive working, that has since broke. When register keepalive was working, I was able to place call in either direction but ACK and BYE was not being routed past kamailio.
Registrations are forwarded to the PBX using add_path() and is working.
Also not included below is the routing to the PBX, that is just setting $du and t_relay, and is also working.
Topology is: UA1 -> NAT -> kamailio -> PBX -> UA2
Using default config file as the example, modified with above changes. I also removed RTP config as that is a non-issue.
request_route {
……
# FLAG MESSAGES FROM PBX
setflag(FLT_PBX);
route(NATDETECT);
……
route[NATDETECT] {
if (nat_uac_test("19")) {
force_rport();
set_contact_alias();
nat_keepalive();
}
return;
}
route[WITHINDLG] {
if (!has_totag()) return;
if (loose_route()) {
route(DLGURI);
} else if ( is_method("ACK") ) {
route(NATMANAGE);
} else if ( is_method("NOTIFY") ) {
record_route();
}
route(RELAY);
exit;
}
if (is_method("SUBSCRIBE") && uri == myself) {
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not here");
exit;
}
route[NATMANAGE] {
if(isflagset(FLT_PBX)) {
handle_ruri_alias();
}
if(!isflagset(FLT_PBX)) {
set_contact_alias();
} return;
}
route[DLGURI] {
if(!isdsturiset()) {
handle_ruri_alias();
}
return;
}
branch_route[MANAGE_BRANCH] {
route(NATMANAGE);
}
onreply_route[MANAGE_REPLY] {
if(status=~"[12][0-9][0-9]") {
route(NATMANAGE);
}
}
failure_route[MANAGE_FAILURE] {
route(NATMANAGE);
if (t_is_canceled()) exit;
-dan
Hi,
I have a strange situation in messaging. I start to send messages continuously from one user to another on iOS devices.
The messages are stored in silo since receiver is in background and registration does not exists.
During the message flow, the receiver registers and the messages are dumped from silo when the sender still sends messages.
The order of messages are important because of encryption, if an earlier message arrives after a later one to the receiver, a new key exchange is needed to decrypt messages, etc...
So the question:
* Is there any technique where I can delay or lock incoming messages on kamailio until silo messages successfully dumped in order to preserve message ordering?
Thanks
Peter
Dear Community,
I wrote before about my random issues with calls disconnection.
We found some issue in our VMWare environment that much packets was lost.
We resolved the issue by moving to other VMWare host however the issue is
still present.
Currently it is random and some calls do not disconnect due to no BYE
forwarded by kamailio to other side.
Here is the pcap of such call :
https://www.dropbox.com/s/7bktz3p4im6ztld/bad-dialog-call.zip?dl=1
We use dialog module and dispatcher.
dlg_manage(); is only executed in this block :
# - flags
# FLT_ - per transaction (message) flags
# FLB_ - per branch flags
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_DLG 4
.
.
.
# account only INVITEs
if (is_method("INVITE")) {
setflag(FLT_DLG); # create dialog << i added it
setflag(FLT_ACCMISSED); # do accounting even if failed << i added it
setflag(FLT_ACC); # do accounting
#route(LIMIT_CALLS);
dlg_manage();
sip_trace();
}
I really have no idea i am unable to find differences between the bad and
good call.
The SIP packets looking good but the BYE is not processed.
Please help me out how to debug it?
I was thinking of adding a log for checking if request is BYE and if it is
check if it match a dialog using is_known_dlg() method.
Please let me know if you see what is wrong.
Just to mention kamailio is listening on private IP with advertise to
public IP.
Best regards!
Hi,
I was wondering if Kamailio can replace SIP methods? i.e., when Kamailio receives SIP INVITE, change it to NOTIFY methods and fork it to multiple destination.
Thanks,
AL
Hi everyone,
Let's say i want to add additional attribute in every dispatcher database
entry in form of:
*Example:*
extension_set=100-199;branch=NewYork
Let's say also i have more than one entry in dispatcher database with these
attributes and same priority.
*EX:*
IP=192.168.1.1;priority=1;attr=extension_set=100-199;branch=NewYork;Descrioption=PBX
Production
IP=192.168.1.2;priority=1;attr=extension_set=100-199;branch=NewYork;Descrioption=PBX
Backup
What i want to achieve is to select multiple destination with ds_select and
algorithm 8(priority) based on dialed extension.
I can get attributes with: $(xavp(_dsdst_=>attrs) but, off course, this may
be possible only after destination selection has been made by dispatcher.
Currently i've create a switch statement in order set statically a variable
with the right priority like:
# dial number selection
switch($rU) {
case /"^[1][0-9][0-9]$":
# starting with 1XX
xlog("L_NOTICE","THE DIALED NUMBER IS: $rU ...
Searching for available destinations!!!\n");
$var(ds_priority) = 1;
break;
default:
exit;
}
ds_select_dst($var(ds_priority), 8); #Get an up destination from
dispatcher with priority 1
xlog("L_NOTICE","Calling Dispatcher $du -- $siz:$sp with
PARAMETER ATTRIBUTE: (attrs: $xavp(_dsdst_=>attrs))\n");
xlog("L_NOTICE","THE BRANCH IS SET AS:
$(xavp(_dsdst_=>attrs){param.value,branch})\n");
xlog("L_NOTICE","THE EXTENSION SET IS:
$(xavp(_dsdst_=>attrs){param.value,extension_set})\n");
t_on_failure("DISPATCH_FAILURE");
but i would like to achieve something more dynamic which permit me to
create a simple database entry.
Probably there's a better way to do it maybe with the help of other modules
or database tables.
If someone can suggest me the best way or simply pointing me on the right
direction.
Appreciate
Regards