[OpenSIPS-Users] Logging selected users full SDP

Matti Zemack Matti.Zemack at rtcfactory.com
Tue Feb 10 13:24:58 CET 2009


Thanks Bogdan.

Of course I was in 1.4-land and missed trace_dialog()...

Thanks again,
Matti


-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro] 
Sent: den 10 februari 2009 11:34
To: Matti Zemack
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Logging selected users full SDP

Hi Matti,

You have two options:
1) per transaction tracing and then do:
          setflag(13);
          sip_trace();

2) per dialog tracing and do:
          trace_dialog();
    Note (new need to load the dialog module also).

Regards.
Bogdan

Matti Zemack wrote:
> Thanks Bogdan and Stefano for your replies earlier!
>
>
> Sorry for asking everyone a follow up question so late... Been working
> on other projects for the last week.
> My basic problem is not knowing enough about how to program the config
> in opensips.
> Lots of example scripts would be a big help... (I could set up some
sort
> of de-classified, open for everyone, "working config" repository if
> wanted. Maybe on the wiki? Just mail me configs without personal
details
> together with some basic info like OpenSIPS version etc.)
>
>
> Anyway, I just can't get the sip_trace() to be true throughout the
whole
> DIALOGUE. I'm hoping for sip_trace to work if flag(13) is set. I would
> like all SDP for that user being kept in the sip_trace table. I
suppose
> I'm doing things in the wrong way. Most thankful for more advice!
>
> Config file (in shortened form):
>
------------------------------------------------------------------------
> --------------------------------------------
> #Of course loadmodules, and other modparams...
> modparam("auth_db", "load_credentials", "do_siptrace")       #
> Individual user's SipTrace-Flag
> modparam("siptrace", "db_url", "the usual DB connect stuff")
> modparam("siptrace", "trace_on", 1)
> modparam("siptrace", "table", "sip_trace")
> modparam("siptrace", "trace_flag", 13)
>
> route{	xlog("\n-- Is Siptrace flag set for subscriber? --
> $avp(s:do_siptrace)\n");
> 	if (isflagset(13)) {xlog("-- Flag 13 = SET\n");} else {xlog("--
> Flag 13 = NOT set\n");}
>
> 	# sip_trace();    # NOTE 2
> 	# setflag(13);    # NOTE 2
>
> 	if (is_method("REGISTER")) {
> 		if (!www_authorize("", "subscriber")) {
> 			www_challenge("", "0");
> 			exit;
> 		}
> 		if (!check_to()) {
> 			sl_send_reply("403","Forbidden auth ID");
> 			exit;
> 		}
> 		if (!save("location")) {
> 			sl_reply_error();
> 		} else {
> 			xlog("Saved new location $from\n");
> 			if ($avp(s:do_siptrace)==1) {
> 				xlog("\n-- do_siptrace=TRUE\n");
> 				# sip_trace(); # This should not be
> needed as I setflag(13) below. NOTE 1.
> 				setflag(13);
> 			} else {
> 				xlog("\n-- do_siptrace=FALSE\n");
> 			}
> 			
> 			###  Below is Working! Insert or Update latest
> registration info in usr_preferences as 'registerkeeper'
> 			###  for later usage...
> 			###  Completely separate matter!
> 	    		avp_db_query("INSERT INTO usr_preferences
> (username, domain, attribute, value, last_modified)
> 		  	VALUES ('$aU', '$od', 'registerkeeper', '$si:$sp
> - $ua', FROM_UNIXTIME('$Ts'))
> 		  	ON DUPLICATE KEY UPDATE value='$si:$sp - $ua',
> last_modified=FROM_UNIXTIME('$Ts')");
> 		}
> 		exit;
> 	}
> }
>
------------------------------------------------------------------------
> --------------------------------------------
> As you can see I got to NOTE 1. When user authorizes flag(13) is set.
> But nothing is added to the sip_trace table. If NOTE 1 isn't commented
> my table adds the single REGISTER but nothing else from the dialogue.
>
> A note if I uncomment any of the NOTE 2 statements I get all SIP info
> added to the correct table. But for all users of course.
>
> I understand that there is something fundamental with flag handling
> which I don't understand. Bear with me. One of these days I'll
hopefully
> understand?
>
>
> Best Regards,
> Matti Zemack, Stockholm, Sweden
>
>
>   




More information about the Users mailing list