[OpenSIPS-Users] 4xx response to invite

2022-11-15 Thread M S
Hi List,
If I use a block like:

if(is_method("invite") && !has_totags()) {
if() send_reply(402, "more money");
..
}

Then if an invite is received and  is true, a 402 is sent, and then an
ACK is received in response to 402, which has a to_tag too.
This ACK strangely matches both method=invite and !has_totags... and
therefore we (incorrectly) send another 402 in response to ACK.
Is this normal behaviour? or is this happening because I'm doing something
wrong like I need to send 100 Trying and then 402?

Thank you!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] relay invites UAC

2022-11-15 Thread Wadii ELMAJDI | Evenmedia
Hello Everyone,

I am using opensips as sip proxy, receiving invites from my clients (mostly 
b2bua), that i should relay to some gateways.
I am using Dynamic route module for such purpose.
Some of those invites (depending on called DID or gateways probing) should be 
relayed to a sip trunk service provider.
My provider requires a registration, which i did using uac registrant module.
My question, is it possible to route calls to my sip provider knowing it is 
neither a Gateway, nor a subscriber ?

Thank you
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] graceful reload

2022-11-15 Thread M S
Thank you for your suggestions. I have been thinking about changing
sql_cacher options to return an additional field or so. that needs changing
mod_param. You are right about having multiple servers to move the loads
from one to another, but sometimes that is not available for some reason.
I understand that adding this functionality (if not available) means
complete design change, but if it is not available indeed it can be a
suggestion for future versions - after all it seems to me that modules are
.so libraries and they can be loaded/unloaded on the fly (kind of like how
Asterisk does)...

On Tue, Nov 15, 2022 at 4:40 PM Brett Nemeroff  wrote:

> What specific modules did you have in mind to reload.
>
> I know this might not be super helpful for your specific application, but
> you should always try to design your configs to not require this kind of
> rebooting. Sure with larger changes it may be unavoidable, but you should
> also have multiple servers set up so you can drain one and do a rolling
> restart. Happy to chat about a few options.
> -Brett
>
>
> On Tue, Nov 15, 2022 at 8:37 AM M S  wrote:
>
>> Hi list,
>> Is it possible to gracefully (without shutting down and restarting
>> opensips process) reload module configurations (modparam) or add new
>> modules to config? I know reload_routes can be used for routes, but what
>> about modules?
>>
>> Thank you.
>> ___
>> 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
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] graceful reload

2022-11-15 Thread Brett Nemeroff
What specific modules did you have in mind to reload.

I know this might not be super helpful for your specific application, but
you should always try to design your configs to not require this kind of
rebooting. Sure with larger changes it may be unavoidable, but you should
also have multiple servers set up so you can drain one and do a rolling
restart. Happy to chat about a few options.
-Brett


On Tue, Nov 15, 2022 at 8:37 AM M S  wrote:

> Hi list,
> Is it possible to gracefully (without shutting down and restarting
> opensips process) reload module configurations (modparam) or add new
> modules to config? I know reload_routes can be used for routes, but what
> about modules?
>
> Thank you.
> ___
> 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


[OpenSIPS-Users] graceful reload

2022-11-15 Thread M S
Hi list,
Is it possible to gracefully (without shutting down and restarting opensips
process) reload module configurations (modparam) or add new modules to
config? I know reload_routes can be used for routes, but what about modules?

Thank you.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] can not get uac_redirect to work

2022-11-15 Thread Babak Yakhchali
Hi
I'm tryin to handle 302 redirect replies to opensips, In my failure route I
have this:

if (t_check_status("30[12]") && $(hdr(X-xferByCharger))== "true") {

  xlog("failure_route: redirect by charger to $(hdr(Contact))");
  

  if (get_redirects(1,1)){
  xlog("failure_route: after redirect ru:$ru and du:$du");
   t_relay();
  }
exit;
}

and the 302 msg is:
2022/11/15 15:29:25.253868 10.0.0.82:5060 -> 10.0.0.192:5060
SIP/2.0 302 Moved Temporarily
Via: SIP/2.0/UDP 10.0.0.192:5060;branch=z9hG4bK4897.63b48a64.0
Via: SIP/2.0/UDP 172.18.120.236:49276
;received=80.191.36.252;rport=49276;branch=z9hG4bK14771
Max-Forwards: 69
From: "" ;tag=5447
To: ;tag=6Dyya5c1yvpQK
Call-ID: 21726
CSeq: 20 INVITE
*Contact: "unknown" >*
User-Agent: FreeSWITCH-mod_sofia/1.9.0+git~20190122T161705Z~5ac757ce54~64bit
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Reason: Q.850;cause=31;text="NORMAL_UNSPECIFIED"
Content-Length: 0

and opensips logs:
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:uac_redirect:get_redirect: resume branch=0
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:uac_redirect:get_redirect: checking branch=0 (added=0)
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:uac_redirect:get_redirect: branch=0 is a redirect (added=0)
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:core:parse_headers: flags=
*Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:uac_redirect:sort_contacts: sort_contacts: http://sip:123456@10.0.0.82:5060>> q=10*
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:uac_redirect:shmcontact2dset: 1 contacts remaining after filtering and
sorting
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:uac_redirect:shmcontact2dset: adding contact 
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:core:pv_get_dsturi: no destination URI
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:tracer:is_id_traced: trace=on dyn=off
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:tracer:is_id_traced: trace=on dyn=off
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:tracer:sip_context_trace_impl: name hep_tid, hash 1710534437, type 0,
traceable on
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:proto_hep:add_hep_chunk: Chunk with (id=17; vendor=0) not found!
Creating!
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:proto_hep:add_hep_chunk: Hep chunk with (id=17; vendor=0) successfully
built!
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
DBG:core:mk_proxy: doing DNS lookup...
Nov 15 15:52:12 lta-opensips-stage /usr/sbin/opensips[40099]:
failure_route: after redirect *ru:sip:123456@10.0.0.82:5060
 and du:*

Reading uac_redirect docs I expect that Contact header to be used as a new
destination but the original ru is used again!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users