Re: [OpenSIPS-Users] mid_register and its possible bad actions with De-REGISTER
Hi OpenSIPS Community, I would like to try to summarize this post as I have often been helped by posts in this maillists, maybe mine will help someone else too... Problem: Was that everything was built on the fact that the backend(main registrar) as Asterisk on chan_sip, was accepting registrations via mid_registrar with one SIP-number from the same client but from different devices, and in this case when the client has a landline and a mobile phone for example, mobile phone as it was said in the problem can very often re-register with what actually and fights OpenSIPS, when send the function callback to usrloc, from which comes the very de-register, so this de-register breaks in chan_sip peer, when under one SIP-number registered several devices. Here, of course, we can approach with different workarounds, such as transferring registrations to OpenSIPS, switching from chan_sip to res_pjsip... and other types of solutions that will lead you to solving new problems, but how could you do without it )) I've looked at quite a few PN question, video/forums/maillists, and in total I've managed for Linphone via usrloc/registrar/mid_registrar to send push notification, at least for now, on Android, via gorush/Firebase, and in total I thought my messages about disabling in modparam some callback functions are not important enough, which are probably available to OpenSIPS developers, that is, the problem can really be tried to solve in another way, well, or make changes in the issue at once in the code, which will be checked like code review from project developers : ) Cheers. P.S thanks Johan for a short but revealing answer about PN. > or you don't support push notifications. On 1/9/2024 10:15 AM, Dmitry Ponomaryov wrote: Hello Liviu, In my case, AoR throttling was used, before issue (1), do you also think that this is how it should work? (looks like a CRITICAL) > On the other hand, AoR throttling goes beyond this and just makes sure there is always 1 AoR registered downstream. So on a "contact replace" operation, no SIP signaling should reach the Asterisk in that case. the point is that if different devices are registered under the same AoR, one such De-REGISTER, on the final Asterisk completely deletes the peer, although in some of the locations there is still data and if not for the De-REGISTER, Asterisk would have sent its INVITE, we would go through lookup and call all the devices we need from location via some route, this is the problem that we don’t always need De-REGISTER if there is more than one device under the same AoR(when we don't just reduce REGISTER to the main registrar, but use them as REGISTER from diff devices), which breaks peers on Asterisk with De-REGISTER. but in total, it might be worth making such modparam module mid_registrar to disable De-REGISTER from the OpenSIPS itself, let the registrations themselves expire on the main registrar, and if there is a new registration with a new ctid with ct-throttling schema, then we will simply update peer again... or if someone needs this feature, then let it be possible to choose an interface and not just, for example: socket=1.1.1.1:5060 socket=2.2.2.2:5060 in this case De-REGISTER will go with 1.1.1.1:5060 on main registrar, because it is simply the first one listed socket in cfg. off course, your opinion is needed here, you are developer of this module since 2016 ;) Best regards! (1): https://github.com/OpenSIPS/opensips/issues/3193 On 1/8/24 14:40, Liviu Chircu wrote: On 27.12.2023 11:38, Dmitry Ponomaryov wrote: All this to say, it might make sense to add the ability to disable this De-REGISTER, because with a new registration, we will still send it a registration with an updated contact before the main registrar times out, and there will be no problems, that is, for example, the following settings: modparam("mid_registrar", "outgoing_expires", 600) modparam("mid_registrar", "default_expires", 300) Hello Dmitry, From your scenario, it sounds like maybe you should enable AoR throttling, not just Ct throttling? Because in Ct throttling, each outgoing contact has a unique "ctid=" parameter, so it must be de-registered from the main registrar on each contact replace, since the replacement Contact has a new "ctid=", making it an entirely different SIP URI. On the other hand, AoR throttling goes beyond this and just makes sure there is always 1 AoR registered downstream. So on a "contact replace" operation, no SIP signaling should reach the Asterisk in that case. Best regards. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] mid_register and its possible bad actions with De-REGISTER
Hello Liviu, In my case, AoR throttling was used, before issue (1), do you also think that this is how it should work? (looks like a CRITICAL) > On the other hand, AoR throttling goes beyond this and just makes sure there is always 1 AoR registered downstream. So on a "contact replace" operation, no SIP signaling should reach the Asterisk in that case. the point is that if different devices are registered under the same AoR, one such De-REGISTER, on the final Asterisk completely deletes the peer, although in some of the locations there is still data and if not for the De-REGISTER, Asterisk would have sent its INVITE, we would go through lookup and call all the devices we need from location via some route, this is the problem that we don’t always need De-REGISTER if there is more than one device under the same AoR(when we don't just reduce REGISTER to the main registrar, but use them as REGISTER from diff devices), which breaks peers on Asterisk with De-REGISTER. but in total, it might be worth making such modparam module mid_registrar to disable De-REGISTER from the OpenSIPS itself, let the registrations themselves expire on the main registrar, and if there is a new registration with a new ctid with ct-throttling schema, then we will simply update peer again... or if someone needs this feature, then let it be possible to choose an interface and not just, for example: socket=1.1.1.1:5060 socket=2.2.2.2:5060 in this case De-REGISTER will go with 1.1.1.1:5060 on main registrar, because it is simply the first one listed socket in cfg. off course, your opinion is needed here, you are developer of this module since 2016 ;) Best regards! (1): https://github.com/OpenSIPS/opensips/issues/3193 On 1/8/24 14:40, Liviu Chircu wrote: On 27.12.2023 11:38, Dmitry Ponomaryov wrote: All this to say, it might make sense to add the ability to disable this De-REGISTER, because with a new registration, we will still send it a registration with an updated contact before the main registrar times out, and there will be no problems, that is, for example, the following settings: modparam("mid_registrar", "outgoing_expires", 600) modparam("mid_registrar", "default_expires", 300) Hello Dmitry, From your scenario, it sounds like maybe you should enable AoR throttling, not just Ct throttling? Because in Ct throttling, each outgoing contact has a unique "ctid=" parameter, so it must be de-registered from the main registrar on each contact replace, since the replacement Contact has a new "ctid=", making it an entirely different SIP URI. On the other hand, AoR throttling goes beyond this and just makes sure there is always 1 AoR registered downstream. So on a "contact replace" operation, no SIP signaling should reach the Asterisk in that case. Best regards. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] [mid_register and its possible bad actions with De-REGISTER]
and we also have an unpleasant situation with the interfaces from which this same De-REGISTER comes, in the latest versions 3.2, we get from the interface that was first written in the socket, and not from which the registration on the main registrar. was this planned? maybe it’s better to put it in modparam of module mid_registrar? ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] [mid_register and its possible bad actions with De-REGISTER]
Hello, well, okay if we are limited to one contact, the port for example of a contact changes conditionally on average every ~300sec, because of this, with a new registration we force it with the "f" flag, and thereby making De-REGISTER towards the main register, then there is each new registration that deletes an entry in "location", thereby creating a De-REGISTER before/after REGISTER. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] mid_register and its possible bad actions with De-REGISTER
Hello, opensips community, let's imagine default situations where we have dynamic users who can move and change FREQUENTLY! ip-address on phone, and re-send the registration, and at the same time we have in the configs: mid_registrar_save("location","c1f"); in this case, we receive with any new registration from the user, the old registration will be deleted: PQsendQuery(delete from location where contact_id=...) mid_registrar:reg_tm_cback: >> [REPLY] UNREGISTER ! this is in Contact throttling, reflected by contact_id. and each deletion of a contact from the location table leads to a De-REGISTER, and a new register, is such a De-REGISTER needed?? which if this all happens in throttling mode, and OpenSIPS knows about all contacts, and let the final server be Asterisk , the main thing is to send INVITE to OpenSIPS for further work. All this to say, it might make sense to add the ability to disable this De-REGISTER, because with a new registration, we will still send it a registration with an updated contact before the main registrar times out, and there will be no problems, that is, for example, the following settings: modparam("mid_registrar", "outgoing_expires", 600) modparam("mid_registrar", "default_expires", 300) From doc mid_registrar: A common occurrence is for some SIP User Agents to lose their network connection (especially when dealing with mobile devices), hence they do not properly de-register from the mid-registrar. In this case, in order to avoid stale registrations on the main registrar (which contains SIP contacts with greatly extended lifetimes!), the mid-registrar will appropriately generate De-REGISTER requests and remove these contacts from the main registrar's location service as soon as it considers them to have expired. Thank you in advance! ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Opensips and rtpengine_play_media not absorbing ACK
It turns out that this is no early_media, there were simply successful attempts with 183 Session Progress, which is why there was such a misunderstanding, I’ll attach the snippet code again in plain text: route { if (is_method("INVITE")) { create_dialog(); route(media); exit; } } route[media] { if (has_body("application/sdp")) { rtpengine_offer(); } $json(reply) := $rtpquery; $var(port)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local port); remove_body_part(); append_to_reply("Contact: \r\n"); append_to_reply("Content-Type: application/sdp\r\n"); $var(body) = $(rb{re.subst,/(IP4.).*/\1$socket_in(ip)/g}); $var(body) = $(var(body){re.subst,/(audio.)./\1$var(port)/g}); t_reply_with_body(200, "OK", $var(body)); rtpengine_play_media("call-id=$ci from-tag=$ft file=/etc/rtpengine/media.wav"); async(sleep(10), after_media); } route[after_media] { if (t_was_cancelled()) { rtpengine_delete(); exit; } else { rtpengine_delete(); sl_send_reply(486,"Busy here"); exit; } } and pined previous posts below :) ------ Message: 2 Date: Fri, 3 Nov 2023 16:00:22 +0500 From: Dmitry Ponomaryov To:users@lists.opensips.org Subject: Re: [OpenSIPS-Users] Opensips and rtpengine_play_media not absorbing ACK Message-ID:<3971cbc2-7281-2299-4212-7f241e8b8...@gmail.com> Content-Type: text/plain; charset="utf-8"; Format="flowed" Hello everyone, I would like to show my part of the code when playing early media after 200OK, when creating dialogs, I substituted $DLG_did in the contact of my dialog, and received the same $DLG_did for my dialog in ACK, but OpenSIPS also continued to send 200OK , despite having already received an ACK response. route { # initial invite if (is_method("INVITE")) { create_dialog(); route(early_media); exit; } } route[early_media] { if (has_body("application/sdp")) { rtpengine_manage(); } $json(reply) := $rtpquery; $var(port)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local port); remove_body_part(); append_to_reply("Contact: \r\n"); append_to_reply("Content-Type: application/sdp\r\n"); $var(body) = $(rb{re.subst,/(IP4.).*/\1$socket_in(ip)/g}); $var(body) = $(var(body){re.subst,/(audio.)./\1$var(port)/g}); t_reply_with_body(200, "OK", $var(body)); rtpengine_play_media("call-id=$ci from-tag=$ft file=/etc/rtpengine/media.wav"); async(sleep(10), after_early_media); } route[after_early_media] { if (t_was_cancelled()) { rtpengine_delete(); exit; } else { rtpengine_delete(); sl_send_reply(486,"Busy here"); exit; } } I don’t know if Kevin example was with creating a dialog, but I also noticed this problem through transaction... thanks -- next part -- An HTML attachment was scrubbed... URL:<http://lists.opensips.org/pipermail/users/attachments/20231103/059cb479/attachment-0001.html> -- Message: 1 Date: Thu, 2 Nov 2023 16:32:02 -0700 From: Kevin Kennedy To: OpenSIPS users mailling list Subject: [OpenSIPS-Users] Opensips and rtpengine_play_media not absorbing ACK Message-ID: Content-Type: text/plain; charset="utf-8" I am trying to build a solution where Opensips 3.2+ with RTPengine acts as a UAC, answers a call with 200OK, plays media from file, and will terminate the call right after playing announcement. Opensips is responding with 200OK with SDP body and making the correct changes for the IP, but when the ACK comes back from the UAS, Opensips doesn't seem to absorb it and retransmits the 200OK. Code snippet handling this scenario rtpengine_manage("from-tag=$ft replace-session-connection trust-address replace-origin codec-strip-g729",,$var(body)); append_to_reply("Contact:\r\n"); append_to_reply("Content-Type: application/sdp\r\n"); t_reply_with_body(200, "OK", $var(body)); rtpengine_play_media("from-tag=$ft file=/etc/rtpengine/unk_num.wav"); sleep(10); rtpengine_delete("from-tag=$ft"); #t_reply(603, "Decline"); exit(); What do I need to add to handle this scenario correctly? Note: I was able to get this to work with Early Media (183 reply_with_body, and send t_reply(603, "Decline")), but we have customers using late media invite as well, so the Early Media option wouldn't work in that case. Thank you. Kevin Kennedy -- next part -- An HTML attachment was scrubbed... URL:<http://lists.opensips.org/pipermail/users/attachments/20231102/dd52d307/attachment-0001.html> -- ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Opensips and rtpengine_play_media not absorbing ACK
Hello everyone, I would like to show my part of the code when playing early media after 200OK, when creating dialogs, I substituted $DLG_did in the contact of my dialog, and received the same $DLG_did for my dialog in ACK, but OpenSIPS also continued to send 200OK , despite having already received an ACK response. route { # initial invite if (is_method("INVITE")) { create_dialog(); route(early_media); exit; } } route[early_media] { if (has_body("application/sdp")) { rtpengine_manage(); } $json(reply) := $rtpquery; $var(port)=$json_pretty(reply/tags/$ft/medias[0]/streams[0]/local port); remove_body_part(); append_to_reply("Contact: \r\n"); append_to_reply("Content-Type: application/sdp\r\n"); $var(body) = $(rb{re.subst,/(IP4.).*/\1$socket_in(ip)/g}); $var(body) = $(var(body){re.subst,/(audio.)./\1$var(port)/g}); t_reply_with_body(200, "OK", $var(body)); rtpengine_play_media("call-id=$ci from-tag=$ft file=/etc/rtpengine/media.wav"); async(sleep(10), after_early_media); } route[after_early_media] { if (t_was_cancelled()) { rtpengine_delete(); exit; } else { rtpengine_delete(); sl_send_reply(486,"Busy here"); exit; } } I don’t know if Kevin example was with creating a dialog, but I also noticed this problem through transaction... thanks ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Correct syntax with statement if
Hello Liviu I created a separate topic where I indicated the condensed syntax of my lines, but a separate question was created there... I’m still learning how to respond to a message in the mail list, sorry for this :) Initially I thought that the brackets, on the contrary, indicate that the text is easy to read, I will definitely look at your link to the code styling, thank you. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] fix scrubbed text
### example 1 if ( has_body("application/sdp") ) { rtpengine_offer(); } ### example 2 if ( has_body("application/sdp") ) rtpengine_offer(); ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Correct syntax with statement if
Have a nice day, everyone, there are cases in routing when in if there is only one command, for example: ### example 1 if ( has_body("application/sdp") ) { rtpengine_offer(); } In this case, how different will this expression be from: ### example 2 if ( has_body("application/sdp") ) rtpengine_offer(); To what extent is it correct to use one or another type of if statement? I understand that if we have to use else, then only the first option will suit us, but here it’s more about a single if.. thanks ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Increased macro MAX_BRANCHES and behavior of tm module
Have a nice day, everyone Question is to increase the value of MAX_BRANCHES[1] to 32, for example, which will go beyond the boundaries of the source code in tm.c, namely condition[2], which clearly shows that only 30 is possible, how critical it is to change the condition in tm.c, in order to get the need value? [1] https://github.com/OpenSIPS/opensips/blob/master/config.h#L169 [2] https://github.com/OpenSIPS/opensips/blob/master/modules/tm/tm.c#L817-L821 ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Calculate the nearest destination based on GeoIP
in addition, for now I use logic like this: route[GEOIP_DST] { # lookup by IP if (!mmg_lookup("lon:lat","$avp(upstreamip)","$avp(lat_lon)")) { xlog("L_INFO", "[GEOIP_DST] $rm $avp(upstreamip) - is not external IP address\n"); return(-1); } xlog("L_INFO", "[GEOIP_DST] $C(gx)$rm - $avp(upstreamip) is external. will calculate the nearest destination$C(xx)\n"); xlog("L_NOTICE","[GEOIP_DST] $rm - source IP=$avp(upstreamip) latitude:$(avp(lat_lon)[0]) and longitude:$(avp(lat_lon)[1])\n"); # set default vars $var(rad) = 6372; # len earth in km $var(min) = $var(rad); # min len between the client and candidate in km $var(pi) = "3.141492"; $var(id) = 0; # start search from this id position in dispatcher table from attrs column $var(maxid) = 50; # finish to this position # coordinates client's in rad math_eval("$(avp(lat_lon)[0]) * $var(pi) / 180", "$var(lat1)"); math_eval("$(avp(lat_lon)[1]) * $var(pi) / 180", "$var(lon1)"); while ( $var(id) < $var(maxid) ) { $var(dst) = $sql_cached_value(id:destination:$var(id)); $var(coo) = $sql_cached_value(id:attrs:$var(id)); if ($var(coo)) { # coordinates candidates in rad math_eval("$(var(coo){s.select,0,,}) * $var(pi) / 180","$var(lat2)"); math_eval("$(var(coo){s.select,1,,}) * $var(pi) / 180","$var(lon2)"); # calculate trigonometry math_eval("sin($var(lat1))", "$var(slat1)"); math_eval("sin($var(lat2))", "$var(slat2)"); math_eval("cos($var(lat1))", "$var(clat1)"); math_eval("cos($var(lat2))", "$var(clat2)"); math_eval("$var(lon2) - $var(lon1)", "$var(delta)"); math_eval("cos($var(delta))", "$var(cdelta)"); math_eval("$var(slat1) * $var(slat2) + $var(clat1) * $var(clat2) * $var(cdelta)", "$var(cdw)"); math_round("$var(cdw)", "$var(cd)", "4"); math_eval("acos($var(cd))", "$var(d)"); math_eval("$var(d) * $var(rad)", "$var(len)"); # or just use linear algebra #math_eval("sqrt((($(avp(lat_lon)[0]) - $(avp(g:coo){s.select,0,,})) ^ 2) + (($(avp(lat_lon)[1]) - $(avp(g:coo){s.select,1,,})) ^ 2))", "$var(len)"); # cut float pont, use decimal $var(len) = $(var(len){s.select,0,.}{s.int}); # calculate minimal destination if ( $var(len) < $var(min) ) { xlog("L_INFO", "= dst=$var(dst) len=$var(len) min=$var(min) id=$var(id) =\n"); $var(min) = $var(len); $avp(media_dst) = $var(dst); } } # counter item $var(id) = $var(id) + 1; } xlog("L_NOTICE", "[GEOIP_DST] $rm - selected destination $C(gx)$avp(media_dst)$C(xx)\n"); return(1); } -Original Message- From: Dmitry Sent: Wednesday, March 20, 2019 1:00 PM To: 'users@lists.opensips.org' Subject: Calculate the nearest destination based on GeoIP Hi there, Maybe you know the best way to calculate the nearest routing point based on geoip data? an example: I have 3 rtpengine relays on a different country, and I can set its geo-coordinate in DB and set id for each of them via rtpengine_use_set() function in the routing script. Also, I have goip lookup via mmg_lookup() function that can give me a coordinate a caller by IP address. A caller comes from the country that _doesn't have_ rtpengine relay and I need to calculate the nearest rtpengine id for set it as prefer based on its IP address Any advice is appreciated. Thanks ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Calculate the nearest destination based on GeoIP
Hi there, Maybe you know the best way to calculate the nearest routing point based on geoip data? an example: I have 3 rtpengine relays on a different country, and I can set its geo-coordinate in DB and set id for each of them via rtpengine_use_set() function in the routing script. Also, I have goip lookup via mmg_lookup() function that can give me a coordinate a caller by IP address. A caller comes from the country that _doesn't have_ rtpengine relay and I need to calculate the nearest rtpengine id for set it as prefer based on its IP address Any advice is appreciated. Thanks ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Segfault in 2.4.5
Hi Bogdan-Andrei, The main point is got help with resolving the issue ASAP. I’m sorry if it sounds boring, but the issue is critical for me. And I understand that guys in the project very busy, so I try to get user’s helps. Have a good day. From: Bogdan-Andrei Iancu Sent: Wednesday, March 13, 2019 10:33 AM To: OpenSIPS users mailling list ; Dmitry Subject: Re: [OpenSIPS-Users] Segfault in 2.4.5 Hi Dimitry, What is the point of this email ? I see the ticket is opened some time ago and there is someone already working on it . Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer https://www.opensips-solutions.com OpenSIPS Summit 2019 https://www.opensips.org/events/Summit-2019Amsterdam/ On 03/12/2019 07:28 PM, Dmitry wrote: Hi There, I get segfault in opensips 2.4.5 every ~5 minutes. Could you help to fix it? Debug in attachment. I'm ready to give additional information if needed. The issue on github https://github.com/OpenSIPS/opensips/issues/1624 Thanks ___ Users mailing list Users@lists.opensips.org <mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Segfault in 2.4.5
Hi There, I get segfault in opensips 2.4.5 every ~5 minutes. Could you help to fix it? Debug in attachment. I'm ready to give additional information if needed. The issue on github https://github.com/OpenSIPS/opensips/issues/1624 Thanks debug.log.gz Description: Binary data ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Handling 488 on a leg B
Hi Bogdan, Thank you indeed for the help! After moving the first changing body to branch (and second too), it works perfect. From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Friday, February 2, 2018 5:18 PM To: Dmitry ; 'OpenSIPS users mailling list' Subject: Re: [OpenSIPS-Users] Handling 488 on a leg B Hi Dmitry, In order to push per-branch changes (changes which are specific only to a certain branch and not to all of them), you need to use the branch route - see http://www.opensips.org/Documentation/Script-Routes-2-3#toc2 So, put the code for changing the body via rtpengine into a branch route. Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Summit 2018 http://www.opensips.org/events/Summit-2018Amsterdam On 02/02/2018 12:53 PM, Dmitry wrote: Hi Bogdan, I change both of them. The first INVITE and the second (after 488). The first apply successfully, but the second (that in the failure_route) does not. My script looks like this: route { … t_on_reply("ONREPLY”); if (isbflagset(NAT_BFLAG) && af!=INET6) { force_rport(); # add rport to first line Via: route(RTPENGINE_OFFER); # make offer } … t_relay(); … } route[RTPENGINE_OFFER] { … $avp(rtp_profile) = "trust-address replace-origin replace-session-connection ICE=remove DTLS=off RTP/SAVP"; if (rtpengine_offer("$avp(rtp_profile)","$avp(rtp_socket)","$avp(rtp_body)")) { remove_body_part(); add_body_part("$avp(rtp_body)", "application/sdp"); # first changing leg-B - successfully } … } onreply_route[ONREPLY] { … t_on_reply("RTPENGINE_ANSWER"); # positive t_on_failure("RTPENGINE_488"); # negative … } failure_route[RTPENGINE_488] { … if (t_check_status("488") ) { # try to change SDP in leg-B after 488 received - unsuccessfully # it returns: ERROR:rtpengine:rtpe_function_call: can't extract body from the message. # from which message? if (rtpengine_offer("trust-address replace-origin replace-session-connection ICE=remove DTLS=off RTP/AVP","$avp(rtp_socket)","$avp(rtp_body)")) { remove_body_part(); add_body_part("$avp(rtp_body)", "application/sdp"); } # # just replace with re.subst $avp(rtp_body) = $(avp(rtp_body){re.subst,/SAVP/AVP/g}); $avp(rtp_body) = $(avp(rtp_body){re.subst,/a=crypto.*//g}); # if I use remove_body_part(), then add_body_part() is not adds content. INVITE sends without body. remove_body_part(); # if I don’t use remove_body_part(), then INVITE contains TWO sdp body with RTP/SAVP and RTP/AVP add_body_part("$avp(rtp_body)", "application/sdp"); # xlog("rtp_body=$avp(rtp_body)\n"); # xlog for $avp(rtp_body) shows unchanged content (with RTP/SAVP) … t_relay(); } … } From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Thursday, February 1, 2018 7:51 PM To: Dmitry <mailto:neta...@gmail.com> ; 'OpenSIPS users mailling list' <mailto:users@lists.opensips.org> Subject: Re: [OpenSIPS-Users] Handling 488 on a leg B Hi Dmitry, In failure route you re-process the original request (INVITE) and not the 488 reply - the reply is just the trigger. Do you change the INVITE SDP before the first attempt (which ends with 488) ? Or you change it for the first time in the failure route ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Summit 2018 http://www.opensips.org/events/Summit-2018Amsterdam On 02/01/2018 05:34 PM, Dmitry wrote: Hello Bogdan, Thank you for advice. I catched 488 and can send INVITE from failure_route, but I can’t modify body inside it. The main goal is change SAVP profile to AVP when 488 received. I tried to do it via rtpengine_offer function. It doesn’t work. I guess, it try to read the body from response (488 in my case) but not from request. I tried to rewrite body via remove_body_part and add_body_part functions, it also doesn’t work. So, I don’t understand how exactly rewrite body in failure_route before do t_relay(). In addition, I tried making a new branch (via append_branch function and via branch_route). It just duplicate my re-INVITE without changing the body. Could you please drop a hint (example on few lines of code) how to do it? Thanks. From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Wednesday, January 31, 2018 6:55 PM To: OpenSIPS users mailling list <mailto:users@lists.opensips.org> ; Dmitry <mailto:neta...@gmail.com> Subject: Re: [OpenSIPS-Users] Handling 488 on a leg B Hello Dmitry, What you want to do is called (in SIP) serial forking. Use
Re: [OpenSIPS-Users] Handling 488 on a leg B
Hi Bogdan, I change both of them. The first INVITE and the second (after 488). The first apply successfully, but the second (that in the failure_route) does not. My script looks like this: route { … t_on_reply("ONREPLY”); if (isbflagset(NAT_BFLAG) && af!=INET6) { force_rport(); # add rport to first line Via: route(RTPENGINE_OFFER); # make offer } … t_relay(); … } route[RTPENGINE_OFFER] { … $avp(rtp_profile) = "trust-address replace-origin replace-session-connection ICE=remove DTLS=off RTP/SAVP"; if (rtpengine_offer("$avp(rtp_profile)","$avp(rtp_socket)","$avp(rtp_body)")) { remove_body_part(); add_body_part("$avp(rtp_body)", "application/sdp"); # first changing leg-B - successfully } … } onreply_route[ONREPLY] { … t_on_reply("RTPENGINE_ANSWER"); # positive t_on_failure("RTPENGINE_488"); # negative … } failure_route[RTPENGINE_488] { … if (t_check_status("488") ) { # try to change SDP in leg-B after 488 received - unsuccessfully # it returns: ERROR:rtpengine:rtpe_function_call: can't extract body from the message. # from which message? if (rtpengine_offer("trust-address replace-origin replace-session-connection ICE=remove DTLS=off RTP/AVP","$avp(rtp_socket)","$avp(rtp_body)")) { remove_body_part(); add_body_part("$avp(rtp_body)", "application/sdp"); } # # just replace with re.subst $avp(rtp_body) = $(avp(rtp_body){re.subst,/SAVP/AVP/g}); $avp(rtp_body) = $(avp(rtp_body){re.subst,/a=crypto.*//g}); # if I use remove_body_part(), then add_body_part() is not adds content. INVITE sends without body. remove_body_part(); # if I don’t use remove_body_part(), then INVITE contains TWO sdp body with RTP/SAVP and RTP/AVP add_body_part("$avp(rtp_body)", "application/sdp"); # xlog("rtp_body=$avp(rtp_body)\n"); # xlog for $avp(rtp_body) shows unchanged content (with RTP/SAVP) … t_relay(); } … } From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Thursday, February 1, 2018 7:51 PM To: Dmitry ; 'OpenSIPS users mailling list' Subject: Re: [OpenSIPS-Users] Handling 488 on a leg B Hi Dmitry, In failure route you re-process the original request (INVITE) and not the 488 reply - the reply is just the trigger. Do you change the INVITE SDP before the first attempt (which ends with 488) ? Or you change it for the first time in the failure route ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Summit 2018 http://www.opensips.org/events/Summit-2018Amsterdam On 02/01/2018 05:34 PM, Dmitry wrote: Hello Bogdan, Thank you for advice. I catched 488 and can send INVITE from failure_route, but I can’t modify body inside it. The main goal is change SAVP profile to AVP when 488 received. I tried to do it via rtpengine_offer function. It doesn’t work. I guess, it try to read the body from response (488 in my case) but not from request. I tried to rewrite body via remove_body_part and add_body_part functions, it also doesn’t work. So, I don’t understand how exactly rewrite body in failure_route before do t_relay(). In addition, I tried making a new branch (via append_branch function and via branch_route). It just duplicate my re-INVITE without changing the body. Could you please drop a hint (example on few lines of code) how to do it? Thanks. From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Wednesday, January 31, 2018 6:55 PM To: OpenSIPS users mailling list <mailto:users@lists.opensips.org> ; Dmitry <mailto:neta...@gmail.com> Subject: Re: [OpenSIPS-Users] Handling 488 on a leg B Hello Dmitry, What you want to do is called (in SIP) serial forking. Use failure_route{} to catch the 488 and to add a create a new branch (with modified body) . See: http://www.opensips.org/Documentation/Script-Routes-2-3#toc3 Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Summit 2018 http://www.opensips.org/events/Summit-2018Amsterdam On 01/30/2018 02:56 PM, Dmitry wrote: Hello all, Could you say how can I re-send INVITE with changed SDP to B-leg after receive 488 from it? Call flow: -> A-leg INVITE <- A-leg 100 -> B-leg INVITE <- B-leg 100 <- B-leg 488 – I catch it, and want to send INVITE again with properly SDP -> B-leg ACK <-A-leg 488 -> B-leg ACK Thanks for any advice. Cheers! ___ Users mailing list Users@lists.opensips.org <mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Handling 488 on a leg B
Hello Bogdan, Thank you for advice. I catched 488 and can send INVITE from failure_route, but I can’t modify body inside it. The main goal is change SAVP profile to AVP when 488 received. I tried to do it via rtpengine_offer function. It doesn’t work. I guess, it try to read the body from response (488 in my case) but not from request. I tried to rewrite body via remove_body_part and add_body_part functions, it also doesn’t work. So, I don’t understand how exactly rewrite body in failure_route before do t_relay(). In addition, I tried making a new branch (via append_branch function and via branch_route). It just duplicate my re-INVITE without changing the body. Could you please drop a hint (example on few lines of code) how to do it? Thanks. From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Wednesday, January 31, 2018 6:55 PM To: OpenSIPS users mailling list ; Dmitry Subject: Re: [OpenSIPS-Users] Handling 488 on a leg B Hello Dmitry, What you want to do is called (in SIP) serial forking. Use failure_route{} to catch the 488 and to add a create a new branch (with modified body) . See: http://www.opensips.org/Documentation/Script-Routes-2-3#toc3 Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com OpenSIPS Summit 2018 http://www.opensips.org/events/Summit-2018Amsterdam On 01/30/2018 02:56 PM, Dmitry wrote: Hello all, Could you say how can I re-send INVITE with changed SDP to B-leg after receive 488 from it? Call flow: -> A-leg INVITE <- A-leg 100 -> B-leg INVITE <- B-leg 100 <- B-leg 488 – I catch it, and want to send INVITE again with properly SDP -> B-leg ACK <-A-leg 488 -> B-leg ACK Thanks for any advice. Cheers! ___ Users mailing list Users@lists.opensips.org <mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Handling 488 on a leg B
Hello all, Could you say how can I re-send INVITE with changed SDP to B-leg after receive 488 from it? Call flow: -> A-leg INVITE <- A-leg 100 -> B-leg INVITE <- B-leg 100 <- B-leg 488 – I catch it, and want to send INVITE again with properly SDP -> B-leg ACK <-A-leg 488 -> B-leg ACK Thanks for any advice. Cheers! ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Question about run exec from route script periodically.
Hi Bogdan-Andrei, Exactly. Script send a push via iOS server, the server send the push notification for wake up a client, it wakes up and send REGISTER to my proxy, and authenticated. Then the client go to background again. That’s all. I don't use nathelper module, because it is not make sense (client will not respond, because it frozen) So, I need to concern about keep alive _useragent_ in DB by himself. From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Friday, November 24, 2017 2:35 PM To: neta...@gmail.com; 'OpenSIPS users mailling list' Subject: Re: [OpenSIPS-Users] Question about run exec from route script periodically. Hi Dmitry, So, basically you want to do a kind of user pinging, but not via SIP (as nathelper is doing), but via PN, using your external script ? Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 11/24/2017 12:19 AM, neta...@gmail.com <mailto:neta...@gmail.com> wrote: Hi Bogdan-Andrei, I've tested the timer_route, it works well. But ,as it turned out, my issue is broader. === So, if I use the timer_route, it runs some logic at specific time. I'm imagine, that users will be more then 100, so 100+ requests at one time will send keepalive to iOS server... Thereby, I'll try to rephrase my question: How can I run an external script _periodically_ for keep alive _useragent_ record in location table, and do not do it simultaneously. I guess, I need to bind the logic to expires time of the acc. I can try to get it time from the location table, but maybe exists some graceful way for it? BR, Dmitry _ From: Dmitry Sent: Nov 23, 2017 5:56 PM To: 'Bogdan-Andrei Iancu'; 'OpenSIPS users mailling list' Subject: RE: [OpenSIPS-Users] Question about run exec from route script periodically. Hello Bogdan-Andrei, Thank you for reply. It seems like that’s what I need. BR, Dmitry From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Thursday, November 23, 2017 5:11 PM To: OpenSIPS users mailling list <mailto:users@lists.opensips.org> ; Dmitry <mailto:neta...@gmail.com> Subject: Re: [OpenSIPS-Users] Question about run exec from route script periodically. Hello Dmitry, Maybe the timer_route[] will help with this ? http://www.opensips.org/Documentation/Script-Routes-2-3#toc8 Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 11/23/2017 01:10 PM, Dmitry wrote: Hello All, I don’t found the info in google, so I’ll try to ask here. Data: I have some custom SIP client for iIOS with logic wake up via push notification and most of the time it working in a background. The client send REGISTER in first time and go to the background. Now I have a special _useragent_ for next steps for detect it as my app. When a caller try to call to special client, opensips detect _useragent_ and run php script for send push notification (before send INVITE forth) to iOS server and will wait 2 sec in async mode. In this time, iOS client (callee) receive push, “wake up” and send REGISTER to opensips. So, registration completed, we run LOOKUP route with search updated “Contact” data for callee. ==opensips router snippet == async(exec("/etc/opensips/ios/wakeup.php '$var(ua)' '$var(key)'", "$var(out)", "$var(err)"), LOOKUP); === My question is: How can I run an external script (via exec/etc app inside the routing script) _periodically_ for keep alive _useragent_ record in location table? Something like a cron inside opensips maybe. I’ll glad to any ideas. PS. For keep alive “normal” users I use nathelper directives: sipping_bflag remove_on_timeout_bflag natping_interval ping_threshold max_pings_lost BR, Dmitry ___ Users mailing list Users@lists.opensips.org <mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Question about run exec from route script periodically.
Hello Bogdan-Andrei, Thank you for reply. It seems like that’s what I need. BR, Dmitry From: Bogdan-Andrei Iancu [mailto:bog...@opensips.org] Sent: Thursday, November 23, 2017 5:11 PM To: OpenSIPS users mailling list ; Dmitry Subject: Re: [OpenSIPS-Users] Question about run exec from route script periodically. Hello Dmitry, Maybe the timer_route[] will help with this ? http://www.opensips.org/Documentation/Script-Routes-2-3#toc8 Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 11/23/2017 01:10 PM, Dmitry wrote: Hello All, I don’t found the info in google, so I’ll try to ask here. Data: I have some custom SIP client for iIOS with logic wake up via push notification and most of the time it working in a background. The client send REGISTER in first time and go to the background. Now I have a special _useragent_ for next steps for detect it as my app. When a caller try to call to special client, opensips detect _useragent_ and run php script for send push notification (before send INVITE forth) to iOS server and will wait 2 sec in async mode. In this time, iOS client (callee) receive push, “wake up” and send REGISTER to opensips. So, registration completed, we run LOOKUP route with search updated “Contact” data for callee. ==opensips router snippet == async(exec("/etc/opensips/ios/wakeup.php '$var(ua)' '$var(key)'", "$var(out)", "$var(err)"), LOOKUP); === My question is: How can I run an external script (via exec/etc app inside the routing script) _periodically_ for keep alive _useragent_ record in location table? Something like a cron inside opensips maybe. I’ll glad to any ideas. PS. For keep alive “normal” users I use nathelper directives: sipping_bflag remove_on_timeout_bflag natping_interval ping_threshold max_pings_lost BR, Dmitry ___ Users mailing list Users@lists.opensips.org <mailto:Users@lists.opensips.org> http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] Question about run exec from route script periodically.
Hello All, I don’t found the info in google, so I’ll try to ask here. Data: I have some custom SIP client for iIOS with logic wake up via push notification and most of the time it working in a background. The client send REGISTER in first time and go to the background. Now I have a special _useragent_ for next steps for detect it as my app. When a caller try to call to special client, opensips detect _useragent_ and run php script for send push notification (before send INVITE forth) to iOS server and will wait 2 sec in async mode. In this time, iOS client (callee) receive push, “wake up” and send REGISTER to opensips. So, registration completed, we run LOOKUP route with search updated “Contact” data for callee. ==opensips router snippet == async(exec("/etc/opensips/ios/wakeup.php '$var(ua)' '$var(key)'", "$var(out)", "$var(err)"), LOOKUP); === My question is: How can I run an external script (via exec/etc app inside the routing script) _periodically_ for keep alive _useragent_ record in location table? Something like a cron inside opensips maybe. I’ll glad to any ideas. PS. For keep alive “normal” users I use nathelper directives: sipping_bflag remove_on_timeout_bflag natping_interval ping_threshold max_pings_lost BR, Dmitry ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to fix Content-Length header?
I have D-Link DIR-615. It's not in the list but SIP ALG is on by default. My friend has the Linksys, not in the list. 2010/10/19 Raúl Alexis Betancor Santana : > On Martes 19 Octubre 2010 18:24:24 Dmitry Kravchenko escribió: >> But doesn't all modern routers are equipped with SIP ALG and >> condsequently it is unportable to require it being OFF? > > On most models, SIP-ALG is disabled by default, because it simply doesn't > work. > > Check here for a list them: > > http://www.voip-info.org/wiki/view/Routers+SIP+ALG > > And don't try to fix the request, because the problem is not only related to > Content-Leght, SIP-ALG implementations are full-broken > > Best regards > -- > Raúl Alexis Betancor Santana > Dimensión Virtual > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to fix Content-Length header?
But doesn't all modern routers are equipped with SIP ALG and condsequently it is unportable to require it being OFF? 2010/10/19 Raúl Alexis Betancor Santana : > On Martes 19 Octubre 2010 17:47:43 Dmitry Kravchenko escribió: >> I wrote in the following way: > > I advise you, don't try to fix SIP-ALG 'fixed' request, you will NEVER, EVER > get to the right way. > > If you have SIP-ALG enabled routers, just change them or disable SIP-ALG. > > Best regards > -- > Raúl Alexis Betancor Santana > Dimensión Virtual > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to fix Content-Length header?
I wrote in the following way: route{ if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } # DIMS fixing wrong content length (due to SIP ALG) $var(actlen)=$(rb{s.len})-2; if( $var(actlen)>0 && !$var(actlen)==$cl ) { xlog("Will fix content length from [$cl] to [$var(actlen)]"); if(remove_hf("Content-Length")) { append_hf("Content-Length: $var(actlen)\r\n"); } } ## NAT Detection ... but still getting some errors in log: Oct 19 20:16:07 scisbo /usr/sbin/opensips[16394]: ERROR:nathelper:force_rtp_proxy_body: incorrect port 0 in reply from rtp proxy Oct 19 20:38:16 scisbo /usr/sbin/opensips[16388]: Will fix content length from [232] to [230] Oct 19 20:38:16 scisbo /usr/sbin/opensips[16392]: Will fix content length from [232] to [230] Oct 19 20:38:16 scisbo /usr/sbin/opensips[16392]: ERROR:core:get_all_bodies: Message is shorter than indicated by content length: got 230 expected 232 Oct 19 20:38:16 scisbo /usr/sbin/opensips[16392]: ERROR:nathelper:force_rtp_proxy: Unable to parse body Oct 19 20:38:16 scisbo /usr/sbin/opensips[16392]: new branch at sip:d...@217.10.34.83:51858;rinstance=0ae6721dad1df336 Oct 19 20:38:17 scisbo /usr/sbin/opensips[16394]: incoming reply Oct 19 20:38:17 scisbo /usr/sbin/opensips[16389]: incoming reply Other words: relaying frame became good (previously callee phone was reporting SIP/2.0 400 Bad Request(Bad Content-Length (larger than datagram) now it is ok) but "inprocess" frame looks like remaining bad. So, how to fix "inprocess" frame? Thanks. 2010/10/19 Anca Vamanu : > Hi, > > Yes, use remove_hf and append_hf from textops module - > http://www.opensips.org/html/docs/modules/1.6.x/textops.html, and to get > the length use the string transformation s.len > -http://www.opensips.org/Resources/DocsCoreTran#toc2. > > Regards, > > -- > Anca Vamanu > www.voice-system.ro > > > > PS: Don't post the same question in more places. > > > On 10/19/2010 03:48 PM, Dmitry Kravchenko wrote: >> I would like to try to use SIP ALG option turned on on routers. But I >> found, that these gateways sometimes forget to change Content-Length >> header while changing a content (for examle, changing an IP address). >> >> So, is it possible to fix content length with opensips script? >> >> Thanks. >> >> > > > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users > ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to fix Content-Length header?
2010/10/19 Anca Vamanu : > On 10/19/2010 04:14 PM, Dmitry Kravchenko wrote: >> Thank you! And how to get access to content string? >> > With $rb pseudo variable > (http://www.opensips.org/Resources/DocsCoreVar#toc58). I found that $(rb{s.len}) mistakes by 2. Is it always so? Thanks. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to fix Content-Length header?
2010/10/19 Anca Vamanu : > On 10/19/2010 04:14 PM, Dmitry Kravchenko wrote: >> 2010/10/19 Anca Vamanu: >> >> >>> Yes, use remove_hf and append_hf from textops module - >>> http://www.opensips.org/html/docs/modules/1.6.x/textops.html, and to get >>> the length use the string transformation s.len >>> -http://www.opensips.org/Resources/DocsCoreTran#toc2. >>> >> Thank you! And how to get access to content string? >> >> > With $rb pseudo variable > (http://www.opensips.org/Resources/DocsCoreVar#toc58). Thanks a lot :) Regards, Dmitry. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to printout certain variables?
Hi! > Those values - uri and myself can only be used for comparisons/tests, > you can not print them. But why??? Who invented this "quark gluon plasma"?? > The uri is the same as $ru so you can print that > and myself is the list of local IP addresses, hostnames and DNS names( > if you have auto_aliases=yes) and aliases ( set with the alias parameter > in the global section of the script). And what about msg:len? Is it also QGP? Is it possible to replace the code if( uri == myself ) with some explicit contruct? It is impossible to debug such magic expressions which are thing-in-itselfs. When they work they work, but when they do not work, you have no way to know why. > On 10/19/2010 03:45 PM, Dmitry Kravchenko wrote: >> Hi! >> >> Is there a way to printout (with xlog) certain variables, like myself, >> uri, msg:len and so on? >> >> I have tried the following ways, but failed: >> >> >> #xlog("L_NOTICE", "DIMS: uri (" + $uri + ") == myself (" + >> $myself + " block..."); >> >> #xlog("L_NOTICE", "DIMS: uri (" + uri + ") == myself (" + >> myself + " block..."); >> >> #$var(myuri) = uri; >> #$var(mymyself) = myself; >> #xlog("L_NOTICE", "DIMS: uri ($var(myuri)) == myself >> ($var(mymyself)) block..."); >> >> #xlog("L_NOTICE", "DIMS: uri ($uri) == myself ($myself) block..."); >> >> #xlog("L_NOTICE", "DIMS: uri ($var(uri)) == myself >> ($var(myself)) block..."); >> >> #$avp(myuri) = uri; >> #$avp(mymyself) = myself; >> #xlog("L_NOTICE", "DIMS: uri ($vap(myuri)) == myself >> ($avp(mymyself)) block..."); >> >> All versions of code cause some error. >> >> Thanks. >> > > ___ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] How to fix Content-Length header?
2010/10/19 Anca Vamanu : > Yes, use remove_hf and append_hf from textops module - > http://www.opensips.org/html/docs/modules/1.6.x/textops.html, and to get > the length use the string transformation s.len > -http://www.opensips.org/Resources/DocsCoreTran#toc2. Thank you! And how to get access to content string? > PS: Don't post the same question in more places. I started to think that sourceforge forums are not visited by specialists enough, since my trivial (as I think) question about how to print variables was not answered for a long time. Thank you anyway. Regards, Dmitry. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] How to fix Content-Length header?
I would like to try to use SIP ALG option turned on on routers. But I found, that these gateways sometimes forget to change Content-Length header while changing a content (for examle, changing an IP address). So, is it possible to fix content length with opensips script? Thanks. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] How to printout certain variables?
Hi! Is there a way to printout (with xlog) certain variables, like myself, uri, msg:len and so on? I have tried the following ways, but failed: #xlog("L_NOTICE", "DIMS: uri (" + $uri + ") == myself (" + $myself + " block..."); #xlog("L_NOTICE", "DIMS: uri (" + uri + ") == myself (" + myself + " block..."); #$var(myuri) = uri; #$var(mymyself) = myself; #xlog("L_NOTICE", "DIMS: uri ($var(myuri)) == myself ($var(mymyself)) block..."); #xlog("L_NOTICE", "DIMS: uri ($uri) == myself ($myself) block..."); #xlog("L_NOTICE", "DIMS: uri ($var(uri)) == myself ($var(myself)) block..."); #$avp(myuri) = uri; #$avp(mymyself) = myself; #xlog("L_NOTICE", "DIMS: uri ($vap(myuri)) == myself ($avp(mymyself)) block..."); All versions of code cause some error. Thanks. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] How to get RADIUS VSA in script?
Hello. We use OpenSER V.1.3.2 During authentification RADIUS server sends (in answers) some additional attributes.(from a dictionary file) VENDOR Cisco 9 ATTRIBUTE h323-return-code103 string Cisco For example h323-return-code =-2 How can I get value of this attribute in openser script? For example RPID I receive as follows: avp_aliases = "username=s:1; calledid=s:30; callingid=s:31; rpid=s:rpid" and I use $avp(rpid) in a code of the program but I cannot receive so h323-return-code because it is Vendor specific. Can I learn it otherwise from a script? Or the single method = setup intermediate RADIUS proxy to translate this attribute to any standard attribute number? Thanks. Dmitry. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users