📄 avpops_user.sgml
字号:
name = avp_spec['/'(table_name|'$'db_scheme)] </emphasis></para></listitem> <listitem><para><emphasis> avp_spec = ''|'s:'|'i:'|avp_name|avp_alias </emphasis></para></listitem> </itemizedlist> </para> </listitem> </itemizedlist> <example> <title><function>avp_db_load</function> usage</title> <programlisting format="linespecific">...avp_db_load("$from","i:678");avp_db_load("$ruri/domain","i:/domain_preferences");avp_db_load("$uuid","s:404fwd/fwd_table");avp_db_load("$ruri","i:123/$some_scheme");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_db_store(source,name)</function> </title> <para> Stores to DB the AVPs corresponding to the given <emphasis>source</emphasis>. </para> <para>The meaning and usage of the parameters are identical as for <emphasis>avp_db_load(source,name)</emphasis> function. Please refer to its description. </para> <example> <title><function>avp_db_store</function> usage</title> <programlisting format="linespecific">...avp_db_store("$to","i:678");avp_db_store("$ruri/username","$email");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_db_delete(source,name)</function> </title> <para> Deletes from DB the AVPs corresponding to the given <emphasis>source</emphasis>. <para>The meaning and usage of the parameters are identical as for <emphasis>avp_db_load(source,name)</emphasis> function. Please refer to its description. </para> <example> <title><function>avp_db_delete</function> usage</title> <programlisting format="linespecific">...avp_db_delete("$to","i:678");avp_db_delete("$ruri/username","$email");avp_db_delete("$uuid","s:404fwd/fwd_table");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_write(value,name)</function> </title> <para> The function writes some value (given) or some information from the SIP message into a new AVP. <para>Meaning of the parameters is as follows:</para> <itemizedlist> <listitem> <para><emphasis>value</emphasis> - the value to be written into the AVP. Parameter syntax: <itemizedlist> <listitem><para><emphasis> value = (variable) | (fix_value) </emphasis></para></listitem> <listitem><para><emphasis> variable = '$src_ip' | (sip_uri)['/'('username'|'domain')]) </emphasis></para></listitem> <listitem><para><emphasis> sip_uri = '$from' | '$to' | '$ruri' </emphasis></para></listitem> <listitem><para><emphasis> fix_value = 'i:'integer | 's:'string | string </emphasis></para></listitem> </itemizedlist> </para> </listitem> <listitem> <para><emphasis>name</emphasis> - the name of the new written AVP. Parameter syntax is: <itemizedlist> <listitem><para><emphasis> name = avp_name | avp_alias </emphasis></para></listitem> </itemizedlist> </para> </listitem> </itemizedlist> <example> <title><function>avp_write</function> usage</title> <programlisting format="linespecific">...avp_write("$to","i:678");avp_write("$ruri/username","$email");avp_write("$src_ip","s:ip");avp_write("i:333","i:6");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_delete(name) </function> </title> <para> Deletes from memory the AVPs with <emphasis>name</emphasis> or, if empty, all AVPs. </para> <para>Meaning of the parameters is as follows:</para> <itemizedlist> <listitem> <para><emphasis>name</emphasis> - which AVPs will be deleted from memory. Parameter syntax is: <itemizedlist> <listitem><para><emphasis> name = (''|'s:'|'i:'|avp_name|avp_alias)['/'flag] </emphasis></para></listitem> <listitem><para><emphasis> flag = 'g'|'G' </emphasis></para></listitem> </itemizedlist> </para> </listitem> </itemizedlist> <example> <title><function>avp_delete</function> usage</title> <programlisting format="linespecific">...avp_delete("i:678/g");avp_delete("$email");avp_delete("i:");avp_delete("");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_pushto(destination,name) </function> </title> <para> Pushes the value of AVP(s) into the SIP message. </para> <para>Meaning of the parameters is as follows:</para> <itemizedlist> <listitem> <para><emphasis>destination</emphasis> - as what will be the AVP value pushed into SIP message. Parameter syntax: <itemizedlist> <listitem><para><emphasis> destination = ruri_dst | hdr_dst </emphasis></para></listitem> <listitem><para><emphasis> ruri_dst = '$ruri'['/'('username'|'domain')] </emphasis></para></listitem> <listitem><para><emphasis> hdr_dst = 'hdr_name'['/'('request'|'reply')] </emphasis></para></listitem> </itemizedlist> </para> </listitem> <listitem> <para><emphasis>name</emphasis> - which AVP(s) should be pushed into the SIP message. Parameter syntax is: <itemizedlist> <listitem><para><emphasis> name = ( avp_name | avp_alias )['/'flags] </emphasis></para></listitem> <listitem><para><emphasis> flags = 'g' </emphasis></para></listitem> </itemizedlist> </para> </listitem> </itemizedlist> <example> <title><function>avp_pushto</function> usage</title> <programlisting format="linespecific">...avp_pushto("$ruri","i:678");avp_pushto("$ruri/domain","s:backup_domains/g");avp_pushto("Email/reply","s:email");avp_pushto("Foo","$bar/g");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_check(name,op_value) </function> </title> <para> Checks the value of the AVP(s) against an operator and value. </para> <para>Meaning of the parameters is as follows:</para> <itemizedlist> <listitem> <para><emphasis>name</emphasis> - which AVP(s) should be checked. Parameter syntax is: <itemizedlist> <listitem><para><emphasis> name = ( avp_name | avp_alias ) </emphasis></para></listitem> </itemizedlist> </para> </listitem> <listitem> <para><emphasis>op_value</emphasis> - define the operator, the value and flags for checking. Parameter syntax is: <itemizedlist> <listitem><para><emphasis> op_value = operator '/' value ['/'flags] </emphasis></para></listitem> <listitem><para><emphasis> operator = 'eq' | 'lt' | 'gt' | 're' </emphasis></para></listitem> <listitem><para><emphasis> value = variable | fix_value </emphasis></para></listitem> <listitem><para><emphasis> variable = '$from'|'$ruri'|'$from'|'$src_ip'|avp_alias <listitem><para><emphasis> fix_value = 'i:'integer | 's:'string | string </emphasis></para></listitem> <listitem><para><emphasis> flags = 'g' | 'G' | 'i' | 'I' </emphasis></para></listitem> </itemizedlist> </para> </listitem> </itemizedlist> <example> <title><function>avp_check</function> usage</title> <programlisting format="linespecific">...avp_check("i:678", "lt/i:345/g");avp_check("s:person","eq/$from/I");avp_check("s:foo","gt/$bar/g");avp_check("s:foo","re/sip:.*@bar.net/g");... </programlisting> </example> </section> <section> <title> <function moreinfo="none">avp_print() </function> </title> <para> Prints the list with all the AVPs from memory. This is only a helper/debug function. </para> <example> <title><function>avp_print</function> usage</title> <programlisting format="linespecific">...avp_print();... </programlisting> </example> </section> </section> <section> <title>Installation & Running</title> <para>The AVPOPS module requires one more column in the <emphasis>usr_preferences</emphasis> table than how it is created now by <emphasis>ser_mysql</emphasis> script. The missing column is <emphasis>"type"</emphasis>. Till the discrepancy is fixed, please add by hand the column <emphasis>"type" integer, not null, default 0 </emphasis>. </para> </section></chapter><!-- Keep this element at the end of the fileLocal Variables:sgml-parent-document: ("avpops.sgml" "Book" "chapter")End:-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -