Is there any useful information ANYWHERE about avp's? I mean, don't take this the wrong way, but I've never had so much trouble interpreting/finding documentation on a subject. I can't even find out how to print the value of an avp with xlog. Is this ACTUALLY DOCUMENTED anywhere? I finally found an example somewhere from a newsgroup posting and used:
xlog ("L_INFO","$avp($foo)");
but openser complains with:
Dec 15 13:21:01 bil-pdev-3 openser[24718]: ERROR:xl_parse_name: unknow avp alias"foo" Dec 15 13:21:01 bil-pdev-3 openser[24718]: XLOG:xdbg_fixup: ERROR: wrong format[$avp($foo)]!
-----Original Message----- From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Sent: Thursday, December 15, 2005 3:43 AM To: Douglas Garstang Cc: users@openser.org Subject: Re: [Users] Variables
Hi Doug,
use avp_printf() or avp_subst() to process the content of an avp - this function covers the assigning operation.
regards, bogdan
Douglas Garstang wrote:
All,
I can't find any documentation of OpenSER use of variables. I'm sending a lot of info to syslog with xlog(), and with multiple threads (processes?) and multiple calls running, all the output is out of sequence. As a result, I'd like to prefix the debug output with the call-id. The call-id however is very long and I'd like to cut it down and only display a portion of it.
How can I extract a string from a SIP message, cut it up, extract the portion I want, and print that portion? OpenSER doesn't seem to have any concept of assigning variables by:
variable = value
Thanks, Doug.
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Is there any useful information ANYWHERE about avp's? I mean, don't take this the wrong way, but I've never had so much trouble interpreting/finding documentation on a subject.
At http://www.openser.org there's a link to this set of tutorials: http://www.voice-system.ro/docs/
The one about the AVPops module is excellent. I hope this set of tutorials will grow over time!
Tim
Douglas Garstang wrote:
Is there any useful information ANYWHERE about avp's? I mean, don't take this the wrong way, but I've never had so much trouble interpreting/finding documentation on a subject. I can't even find out how to print the value of an avp with xlog. Is this ACTUALLY DOCUMENTED anywhere? I finally found an example somewhere from a newsgroup posting and used:
xlog ("L_INFO","$avp($foo)");
but openser complains with:
Dec 15 13:21:01 bil-pdev-3 openser[24718]: ERROR:xl_parse_name: unknow avp alias"foo" Dec 15 13:21:01 bil-pdev-3 openser[24718]: XLOG:xdbg_fixup: ERROR: wrong format[$avp($foo)]!
Looks like the AVP alias is unknown. There are two kinds of AVP: integer based and string based. http://www.voice-system.ro/docs/avpops/ar01s03.html
e.g. xlog ("L_INFO","$avp(s:foo)"); will print the AVP with the string name "foo".
xlog ("L_INFO","$avp(i:102)"); will print the AVP 102.
xlog ("L_INFO","$avp($foo)"); will print the AVP with the alias foo
To use alias, you have to configure them: http://www.voice-system.ro/docs/avpops/ar01s05.html modparam("avpops","avp_aliases","uuid=I:660;foo=i:102")
Thus, if configured foo=i:102, the following 2 statements are the same: xlog ("L_INFO","$avp(i:102)"); xlog ("L_INFO","$avp($foo)");
As interger type AVPs are faster I prefer them. In my config I have:
# AVP configuration # integer aliases (faster than strings) # i:101 = cbcprefix # call by call provider prefix # i:103 = fr_inv_timer # timer for INVITE transactions # i:104 = cansipuri # canonical SIP URI, e.g klaus@enum.at # # pre defined AVPs: # s:rpid = Remote-Party-Id # i:42 = received_avp, used by nathelper and registrar # modparam("avpops","avp_aliases","cbcprefix=I:101;fr_inv_timer=i:103;cansipuri=i:104") # -- tm params -- modparam("tm", "fr_inv_timer_avp", "i:103")
Then, in the routing part I only use the aliases, e.g: # trigger failure in 28 seconds avp_write("i:28","$fr_inv_timer");
lookup("aliases"); avp_write("$ruri","$cansipuri"); #store canonical SIP URI
You also should read the examples at the wiki: http://openser.org/dokuwiki/doku.php?id=avp_examples&DokuWiki=70b22ac08e...
regards Klaus