[OpenSIPS-Users] Trying to get CNAM working with Opensips 1.8

Gordon Sims gsims94 at gmail.com
Sun Nov 23 20:33:35 CET 2014


Thank you in advance,

I¹m trying to get CNAM working with Opensips version 1.8 and hoping to get a
little guidance on this.  I¹m attempting to use the CIDName.com for CNAM and
doing the integration via token, but its not doing 2 things:

1. Not pulling the CNAM via curl as suggested by CIDName.com
2. Not recording it into the MySQL database, even if it¹s null, I would
think that it should still record that piece of it.
Here is the snippet from my opensips.cfg file.  Hoping someone will point
out whats wrong with it.

#### ACCounting module
loadmodule "acc.so"
loadmodule "avpops.so"
loadmodule "exec.so"
loadmodule "uac.so"
modparam("acc", "cdr_flag", "ACC_CDR")
#modparam("acc", "failed_transaction_flag", "ACC_FAILED")
modparam("acc", "db_flag", "ACC_DO")
modparam("acc", "db_url",
        "mysql://username:password@10.20.121.71/database") # CUSTOMIZE ME
modparam("acc", "db_extra", "from_uri=$fU; to_uri=$tU")  #Extra data
#modparam("acc", "db_extra", "cnam=$avp")  #Extra data

If I have the "modparam("acc", "db_extra", "cnam=$avp")  #Extra data
³ uncommented, then I get the following error when reloading opensips:

Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:core:pv_parse_spec: pvar "avp" not found
Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:core:pv_parse_spec: wrong char [p/112] in [$avp] at [3 (0)]
Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:acc:parse_acc_extra: parse failed in <cnam=$avp> around position 5
Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:acc:parse_acc_extra: error
Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:acc:mod_init: failed to parse db_extra param
Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:core:init_mod: failed to initialize module acc
Nov 23 13:22:43 FSSVG0AA1 /usr/local/opensips_proxy/sbin/opensips[18828]:
ERROR:core:main: error while initializing modules


route{

        if (method == "INVITE") {
                create_dialog();
                setflag(ACC_CDR);
                setflag(ACC_DO); # do accounting ...
                record_route();
                xlog("INBOUND CALL,$dd,$ru,$ci,$fn,$fu");
                exec_avp("timeout -s KILL 2 curl
http://dip.cidname.com/$avp(src)?token=XXXXXXXXX-TOKEN-XXXXXXXXXXXXX","$avp(
cnam)");
                uac_replace_from("$avp(cnam)","");
                route(10);
                exit;
        }

The idea behind all of this is the Customer would like to have statistics on
where the calls are coming from or more importantly from who.  Would like to
record this data in the MySQL database and be able to pull it later.  I have
added a field in the Œacc¹ table called Œcnam¹ in hopes to record the
information in there.  Any ideas on how to accomplish this, I am all ears.

Thanks again,

Gordon


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20141123/644506ee/attachment.htm>


More information about the Users mailing list