[SR-Users] Problems with MSILO module can't receive messages with m_dump.

Daniel-Constantin Mierla miconda at gmail.com
Thu Feb 7 16:43:01 CET 2013


Hello,

a way to protect is to have a check on source ip on route AUTH, like:

if(src_ip==myself)
    return;

This will not challenge the requests that are sent from the server itself.

Cheers,
Daniel

On 2/4/13 4:06 PM, Stoyan Mihaylov wrote:
> I had same problem long time ago. When I found enough time, I solved
> it adding in
> route[AUTH]{
> ..............
> 		if (from_uri==myself)
> 		{
> +			if((is_method("MESSAGE"))){
> +				if (is_domain_local("$si")) {
> +					return;
> +				}
> +			}
> ............
> }
> Also, I think sources of m_dump have potential problem - as a matter
> of fact, I got crashes, after solution, which I solved adding next
> modification of msilio.c
> diff --git a/modules/msilo/msilo.c b/modules/msilo/msilo.c
> index 209b309..4bda8fa 100644
> --- a/modules/msilo/msilo.c
> +++ b/modules/msilo/msilo.c
> @@ -1125,8 +1125,16 @@ static int m_dump(struct sip_msg* msg, str* owner_s)
>                          memcpy(tmp_extra_hdrs.s, extra_hdrs_str.s,
> extra_hdrs_str.len);
>                          memcpy(tmp_extra_hdrs.s+extra_hdrs_str.len,
> str_vals[4].s, str_vals[4].len);
>                  } else {
> -                       tmp_extra_hdrs.len = 0;
> -                       tmp_extra_hdrs.s = "";
> +                       tmp_extra_hdrs.len = 0;
> +                       if ((tmp_extra_hdrs.s = pkg_malloc(1)) == NULL)
> +                       {
> +                               LM_ERR("Out of pkg memory");
> +                               if (msilo_dbf.free_result(db_con, db_res) < 0)
> +                                       LM_ERR("failed to free the
> query result\n");
> +                               msg_list_set_flag(ml, mid, MS_MSG_ERRO);
> +                               goto error;
> +                       }
> +                       tmp_extra_hdrs.s[0]='\x0';
>                  }
>                  hdr_str.len = 1024;
>                  if(m_build_headers(&hdr_str, str_vals[3] /*ctype*/,
>
>
> On Mon, Feb 4, 2013 at 10:01 AM, Nord7 <nordseven at gmail.com> wrote:
>> Hello i have two problems with module MSILO and  text messages from SIP
>> client BRIA.
>>
>> 1. I can't send messages with m_dump.
>> I have installed Kamailio 3.3 in default configuration. I'm added
>> "m_dump("$fu")" to my config in route[REGISTRAR]. If i use client CSipSimple
>> for sending messages to offline user "333".  i'm
>>   receive notification message "*** User 333 offline!". Next i connect to
>> Kamailio with user "333" and i see in kamailio log what "m_dumt" trying to
>> send messages but can't because "request authorisation". How to disable
>> authorisation request, without leak security.
>>
>> route[REGISTRAR] {
>>          if (is_method("REGISTER"))
>>          {
>>                  if(isflagset(FLT_NATS))
>>                  {
>>                          setbflag(FLB_NATB);
>>                          # uncomment next line to do SIP NAT pinging
>>                          ## setbflag(FLB_NATSIPPING);
>>                  }
>>                  if (!save("location"))
>>                          sl_reply_error();
>>
>>                  if (m_dump("$fu"))
>>                    {
>>                    log("MSILO: offline messages dumped - if they were\n");
>>                    }
>>                    else
>>                      {
>>                      log("MSILO: no offline messages dumped\n");
>>                      }
>>                  exit;
>>          }
>> }
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
  - http://conference.kamailio.com -




More information about the sr-users mailing list