Bogdan-Andrei Iancu escreveu:
first of all, instead of using Oracle triggers you can log this info directly from OpenSER using avp_db_query http://www.openser.org/docs/modules/1.2.x/avpops.html#AEN268 and pseudo-variables to get the src_ip ($si), src_port ($sp) and expire header. See http://www.openser.org/dokuwiki/doku.php/pseudovariables:devel
That's cool (and a nice thing to know for future projects), but I still have the regseconds problem. I can't get that from pseudovariables. Seems I'm stuck with triggers. But what you say next DOES eliminate a nagging doubt I had:
otherwise, using triggers, you need to look to the "contact" and "received" columns in location. "contact" contains the received contact and "received" the source addr of the REGISTER - used in nat scenarios, where contact has private IPs. so,it depends of your OpenSER cfg, if received is or not populated (via fix_natted_registrar function). Anyhow, first you should try to use received and if empty, use contact. or, if no nat, just use contact.
No NAT here, so I can use contact only and be happy (the DBA is miffed enough about the trigger as it is!)
Many many thanks, Juan