Hi Elena,
I have a few questions in regards to avpops. Hope that you can help.
1. When avp_pushto() is used, the ruri is only used when t_relay is called. However the uri match can't match the regular expression correctly. For example, I have this,
avp_write("sip:nobody@test.com", "s:default"); avp_pushto("$ruri", "s:default"); if (uri =~ "^sip:nobody@") { xlog("L_INFO", "got nobody\n"); } else { xlog("L_INFO", "didn't get nobody\n") }
It would say "didn't get nobody\n".
If I run t_relay, then it is sent to sip:nobody@test.com.
2. Is it possible to have a function to copy an avp to another avp? The application is this, tm module uses one avp to define the invite timer. If there are multiple timer values defined for different scenarios, we need to copy the value into the one used in tm module. For example,
s:pstn_invite=100, s:sip_invite=20, If (the call is to pstn) { avp_copy("s:pstn_invite", "s:callee_fr_inv_timer"); } else { avp_copy("s:sip_invite", "s:callee_fr_inv_timer"); }
3. For performance reasons, we'd like to group all user preference in one domain in one mysql table. Is it possible to specify the table name with an avp?
Regards, Richard
To #1: You need to add a "eat-the-rest" expression to your regex: "^sip:nobody@.*" g-)
Richard wrote:
Hi Elena,
I have a few questions in regards to avpops. Hope that you can help.
- When avp_pushto() is used, the ruri is only used when t_relay is
called. However the uri match can't match the regular expression correctly. For example, I have this,
avp_write("sip:nobody@test.com", "s:default"); avp_pushto("$ruri", "s:default"); if (uri =~ "^sip:nobody@") { xlog("L_INFO", "got nobody\n"); } else { xlog("L_INFO", "didn't get nobody\n") }
It would say "didn't get nobody\n".
If I run t_relay, then it is sent to sip:nobody@test.com.
- Is it possible to have a function to copy an avp to another avp?
The application is this, tm module uses one avp to define the invite timer. If there are multiple timer values defined for different scenarios, we need to copy the value into the one used in tm module. For example,
s:pstn_invite=100, s:sip_invite=20, If (the call is to pstn) { avp_copy("s:pstn_invite", "s:callee_fr_inv_timer"); } else { avp_copy("s:sip_invite", "s:callee_fr_inv_timer"); }
- For performance reasons, we'd like to group all user preference in
one domain in one mysql table. Is it possible to specify the table name with an avp?
Regards, Richard
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-----Original Message----- From: Greger V. Teigre [mailto:greger@teigre.com] Sent: Tuesday, January 11, 2005 8:57 PM To: Richard; 'Elena Ramona Modroiu' Cc: serusers@lists.iptel.org Subject: Re: [Serusers] avpops module
To #1: You need to add a "eat-the-rest" expression to your regex: "^sip:nobody@.*" g-)
Eh... I have used the expression without .* in other cases and no problem...
Richard wrote:
Hi Elena,
I have a few questions in regards to avpops. Hope that you can help.
- When avp_pushto() is used, the ruri is only used when t_relay is
called. However the uri match can't match the regular expression correctly. For example, I have this,
avp_write("sip:nobody@test.com", "s:default"); avp_pushto("$ruri", "s:default"); if (uri =~ "^sip:nobody@") { xlog("L_INFO", "got nobody\n"); } else { xlog("L_INFO", "didn't get nobody\n") }
It would say "didn't get nobody\n".
If I run t_relay, then it is sent to sip:nobody@test.com.
- Is it possible to have a function to copy an avp to another avp?
The application is this, tm module uses one avp to define the invite timer. If there are multiple timer values defined for different scenarios, we need to copy the value into the one used in tm module. For example,
s:pstn_invite=100, s:sip_invite=20, If (the call is to pstn) { avp_copy("s:pstn_invite", "s:callee_fr_inv_timer"); } else { avp_copy("s:sip_invite", "s:callee_fr_inv_timer"); }
- For performance reasons, we'd like to group all user preference in
one domain in one mysql table. Is it possible to specify the table name with an avp?
Regards, Richard
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Richard,
Richard wrote:
Hi Elena,
I have a few questions in regards to avpops. Hope that you can help.
- When avp_pushto() is used, the ruri is only used when t_relay is called.
However the uri match can't match the regular expression correctly. For example, I have this,
avp_write("sip:nobody@test.com", "s:default"); avp_pushto("$ruri", "s:default"); if (uri =~ "^sip:nobody@") { xlog("L_INFO", "got nobody\n"); } else { xlog("L_INFO", "didn't get nobody\n") }
It would say "didn't get nobody\n".
If I run t_relay, then it is sent to sip:nobody@test.com.
I run exactly the piece of script you sent and it worked as expected - I got " got nobody" :-) . To do some extra checking, you can put avp_print() before doing push - it will dump all current avps. Also, after avp_pushto(), insert a xdbg("ruri is %ru\n") to double check what's the RURI value.
- Is it possible to have a function to copy an avp to another avp? The
application is this, tm module uses one avp to define the invite timer. If there are multiple timer values defined for different scenarios, we need to copy the value into the one used in tm module. For example,
s:pstn_invite=100, s:sip_invite=20, If (the call is to pstn) { avp_copy("s:pstn_invite", "s:callee_fr_inv_timer"); } else { avp_copy("s:sip_invite", "s:callee_fr_inv_timer"); }
for the moment no. I'm planning such a functionality along with the possibility of doing several operations on the avp value (concatenation/sum, replacing, etc).
- For performance reasons, we'd like to group all user preference in one
domain in one mysql table. Is it possible to specify the table name with an avp?
No, you cannot load the table name from an avp. For more complex database operations please take a look to database scheme functionality : http://www.voice-system.ro/docs/avpops/ar01s05.html#db_scheme http://www.siphub.net/docs/avpops/ar01s06.html#avp_db_load
Regards, Richard
Regards, Ramona