Re: [OpenSIPS-Users] my problems getting dialplan to work
Hi Wesley, if you set debug = 4, you will get a all the debug messages from the module. It will give you some hints if at least is matching any rule. But what I found strange is that tat the replt_exp field is empty - that is the part to be returned . Regards, Bogdan Wesley Volcov wrote: Hello Bogdan, I made the exemple you wrote above. My script: $var(x) = sip:06; dp_translate(1, $var(x)/$var(tmp)); xlog(-$var(tmp)\n); My database: mysql select * from dialplan; ++--++--++---++---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++---+---+ | 1 |1 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | wes...@voicetechnology.com.br | 0 | ++--++--++---++---+---+ 1 row in set (0.00 sec) My log file: Jan 15 15:30:11 localhost opensips[22981]: -0 I have no log of dialplan module. Is there some configuration to active this module debug ? Regards, Wesley. -- Bogdan-Andrei Iancu www.voice-system.ro ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] my problems getting dialplan to work
Hello Bogdan! I think you could not see the repl_exp value because the line break, this value is my email address (I'm using nabble.com and hiden the email). About debud level, I'm already using debug = 4, but It's not working anyway. I tested with debug =9, but the log appears the same. When I start opensips I can see a strange log: Jan 15 16:01:07 localhost opensips[23064]: ERROR:dialplan:trex_charnode: TREX error letter expected Jan 15 16:01:07 localhost opensips[23064]: ERROR:dialplan:trex_compile: compilation error [letter expected]! Jan 15 16:01:07 localhost opensips[23064]: ERROR:dialplan:build_rule: failed to compile subst expression Jan 15 16:01:07 localhost opensips[23064]: WARNING:dialplan:dp_load_db: failed to build rule - skipping I've deleted all data in dialplan table, but it's still happening. Regards, Wesley Bogdan-Andrei Iancu wrote: Hi Wesley, if you set debug = 4, you will get a all the debug messages from the module. It will give you some hints if at least is matching any rule. But what I found strange is that tat the replt_exp field is empty - that is the part to be returned . Regards, Bogdan Wesley Volcov wrote: Hello Bogdan, I made the exemple you wrote above. My script: $var(x) = sip:06; dp_translate(1, $var(x)/$var(tmp)); xlog(-$var(tmp)\n); My database: mysql select * from dialplan; ++--++--++---++---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++---+---+ | 1 |1 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | wes...@voicetechnology.com.br | 0 | ++--++--++---++---+---+ 1 row in set (0.00 sec) My log file: Jan 15 15:30:11 localhost opensips[22981]: -0 I have no log of dialplan module. Is there some configuration to active this module debug ? Regards, Wesley. -- Bogdan-Andrei Iancu www.voice-system.ro ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users -- View this message in context: http://n2.nabble.com/my-problems-getting-dialplan-to-work-tp3081563p4414342.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] my problems getting dialplan to work
Hi Wesley, if you deleted the whole table, it is impossible to get that error (with no rules to load). Check if you are loading form the right server/DB/table. Regards, Bogdan Wesley Volcov wrote: Hello Bogdan! I think you could not see the repl_exp value because the line break, this value is my email address (I'm using nabble.com and hiden the email). About debud level, I'm already using debug = 4, but It's not working anyway. I tested with debug =9, but the log appears the same. When I start opensips I can see a strange log: Jan 15 16:01:07 localhost opensips[23064]: ERROR:dialplan:trex_charnode: TREX error letter expected Jan 15 16:01:07 localhost opensips[23064]: ERROR:dialplan:trex_compile: compilation error [letter expected]! Jan 15 16:01:07 localhost opensips[23064]: ERROR:dialplan:build_rule: failed to compile subst expression Jan 15 16:01:07 localhost opensips[23064]: WARNING:dialplan:dp_load_db: failed to build rule - skipping I've deleted all data in dialplan table, but it's still happening. Regards, Wesley Bogdan-Andrei Iancu wrote: Hi Wesley, if you set debug = 4, you will get a all the debug messages from the module. It will give you some hints if at least is matching any rule. But what I found strange is that tat the replt_exp field is empty - that is the part to be returned . Regards, Bogdan Wesley Volcov wrote: Hello Bogdan, I made the exemple you wrote above. My script: $var(x) = sip:06; dp_translate(1, $var(x)/$var(tmp)); xlog(-$var(tmp)\n); My database: mysql select * from dialplan; ++--++--++---++---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++---+---+ | 1 |1 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | wes...@voicetechnology.com.br | 0 | ++--++--++---++---+---+ 1 row in set (0.00 sec) My log file: Jan 15 15:30:11 localhost opensips[22981]: -0 I have no log of dialplan module. Is there some configuration to active this module debug ? Regards, Wesley. -- Bogdan-Andrei Iancu www.voice-system.ro ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users -- Bogdan-Andrei Iancu www.voice-system.ro ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] my problems getting dialplan to work
Hi Bogdan. Someone else on my team replicated the problem with the 1.5.1 release. He updated to the latest code from SVN and the problem is fixed there. So that pretty much proves this was a bug that was fixed, but not until after the 1.5.1 release. In the future, for similar situations, is there a bug database for OpenSIPS where we should be looking for these kind of details? Thanks for the help, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Friday, June 19, 2009 4:35 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Todd, could you please update from SVN, from branch 1.5 - I remember a fix related to and I'm not sure if you have it or not. Regards, Bogdan Bradley, Todd wrote: [r...@test7 ~]# opensips -V version: opensips 1.5.1-notls (i386/linux) flags: STATS: Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. svnrevision: unknown @(#) $Id: main.c 5469 2009-03-18 12:43:10Z bogdan_iancu $ main.c compiled on 11:54:04 Jun 10 2009 with gcc 4.1.2 -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Thursday, June 18, 2009 6:36 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, What version of opensips are you using ? Could you pass me the output of opensips -V ? Regards, Bogdan Bradley, Todd wrote: I'm running on GNU/Linux FC7. I know that's pretty old, but it's updated with all the latest package updates. I built opensips-1.5.1-tls from source. Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 11:15 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Todd, this sounds like twilightzone :)...what OS are you using ? regards, Bogdan Bradley, Todd wrote: This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan
Re: [OpenSIPS-Users] my problems getting dialplan to work
[r...@test7 ~]# opensips -V version: opensips 1.5.1-notls (i386/linux) flags: STATS: Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535 poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. svnrevision: unknown @(#) $Id: main.c 5469 2009-03-18 12:43:10Z bogdan_iancu $ main.c compiled on 11:54:04 Jun 10 2009 with gcc 4.1.2 -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Thursday, June 18, 2009 6:36 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, What version of opensips are you using ? Could you pass me the output of opensips -V ? Regards, Bogdan Bradley, Todd wrote: I'm running on GNU/Linux FC7. I know that's pretty old, but it's updated with all the latest package updates. I built opensips-1.5.1-tls from source. Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 11:15 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Todd, this sounds like twilightzone :)...what OS are you using ? regards, Bogdan Bradley, Todd wrote: This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan; ++--++--++---++-- ++--++--++---++- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++-- ++--++--++---++- ++--++--++---++-- ---+---+ | 7 |2 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---++-- ++--++--++---++- ++--++--++---++-- ---+---+ 1 row in set (0.00 sec) Any ideas? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 10:14 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re
Re: [OpenSIPS-Users] my problems getting dialplan to work
Hi Todd, What version of opensips are you using ? Could you pass me the output of opensips -V ? Regards, Bogdan Bradley, Todd wrote: I'm running on GNU/Linux FC7. I know that's pretty old, but it's updated with all the latest package updates. I built opensips-1.5.1-tls from source. Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 11:15 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Todd, this sounds like twilightzone :)...what OS are you using ? regards, Bogdan Bradley, Todd wrote: This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan; ++--++--++---++--- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++--- ++--++--++---++-- ---+---+ | 7 |2 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---++--- ++--++--++---++-- ---+---+ 1 row in set (0.00 sec) Any ideas? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 10:14 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, The attr column is not user in t matching / replacement process - it is a simply opaque string (with no special meaning) that will be automatically pushed into script (via some PV) if the rule matches. If this still does not work for you, please post the opensips log (like last one). Regards, Bogdan Bradley, Todd wrote: Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan; ++--++--++---++-- ++--++--++---++- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs
Re: [OpenSIPS-Users] my problems getting dialplan to work
Has anyone else seen dp_translate not actually translate according to its rules? Are other people using the dialplan module successfully? Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bradley, Todd Sent: Tuesday, June 16, 2009 11:35 AM To: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work I'm running on GNU/Linux FC7. I know that's pretty old, but it's updated with all the latest package updates. I built opensips-1.5.1-tls from source. Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 11:15 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Todd, this sounds like twilightzone :)...what OS are you using ? regards, Bogdan Bradley, Todd wrote: This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan; ++--++--++---++--- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++--- ++--++--++---++-- ---+---+ | 7 |2 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---++--- ++--++--++---++-- ---+---+ 1 row in set (0.00 sec) Any ideas? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 10:14 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, The attr column is not user in t matching / replacement process - it is a simply opaque string (with no special meaning) that will be automatically pushed into script (via some PV) if the rule matches. If this still does not work for you, please post the opensips log (like last one). Regards, Bogdan Bradley, Todd wrote: Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan
Re: [OpenSIPS-Users] my problems getting dialplan to work
Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan; ++--++--++---++- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++- ---+---+ | 7 |2 | 2 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | | ++--++--++---++- ---+---+ 1 row in set (0.00 sec) The only possibly relevant difference I see is that you have a 0 in your attrs column, where I have a blank. Otherwise, it looks like everything's fine, doesn't it? I couldn't figure out what the attrs column was for, so I didn't insert anything into it. According to the docs, it's a General attributes string to be returned in case of rule matching and it's a string. Could you help explain what it's for? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Monday, June 15, 2009 6:28 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Bradley, I re-made your case with: mysql select * from dialplan; ++--++--++---+ ++---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---+ ++---+ | 1 |1 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---+ ++---+ 1 row in set (0.00 sec) and in script: $var(x) = sip:06; dp_translate(1, $var(x)/$var(tmp)); xlog(-$var(tmp)\n); The output was: Jun 16 03:22:34 [7921] DBG:dialplan:dp_get_ivalue: integer value Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: dpid is 1 Jun 16 03:22:34 [7921] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:translate: regex operator testing Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:translate: found a matching rule 0xb56744c0: pr 0, match_exp (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: input sip:06 with dpid 1 = output sip:061...@10.47.19.24 -sip:061...@10.47.19.24 Which looks pretty ok ... Maybe there is something something in the correct data in DB. Regards, Bogdan Bradley, Todd wrote: Hi, I'm new to openSIPS and am trying to set it up with the dialplan module, but I've had a couple problems I can't figure out. The first problem is related to how dp_translate is doing regexp replacements. I have code like this in my route method: if (is_method(INVITE)) { xlog(To user is: $tu\n); xlog(ruri.user is: $ruri.user\n); xlog(avp(s:dest) is: $avp(s:dest)\n); dp_translate(1, $tu/$var(tmp)); xlog(The variable that came out was $var(tmp)\n); setflag(1); # do accounting } And my dialplan DB table has this row for dpid 1: match_exp=(^06.+) subst_exp=(^06.+) repl_exp...@10.47.19.24 When I send in a SIP INVITE that is to sip:06, I expect the dp_translate to convert this to sip:061...@10.47.19.24. But I just get sip:06 back. Here's the output: To user is: sip:06 ruri.user is: null avp(s:dest) is: null Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_ivalue: integer value Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: dpid is 2 Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_svalue: searching 22 Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: input is sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:translate: regex operator testing Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 12
Re: [OpenSIPS-Users] my problems getting dialplan to work
Hi Todd, The attr column is not user in t matching / replacement process - it is a simply opaque string (with no special meaning) that will be automatically pushed into script (via some PV) if the rule matches. If this still does not work for you, please post the opensips log (like last one). Regards, Bogdan Bradley, Todd wrote: Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan; ++--++--++---++- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++- ---+---+ | 7 |2 | 2 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | | ++--++--++---++- ---+---+ 1 row in set (0.00 sec) The only possibly relevant difference I see is that you have a 0 in your attrs column, where I have a blank. Otherwise, it looks like everything's fine, doesn't it? I couldn't figure out what the attrs column was for, so I didn't insert anything into it. According to the docs, it's a General attributes string to be returned in case of rule matching and it's a string. Could you help explain what it's for? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Monday, June 15, 2009 6:28 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Bradley, I re-made your case with: mysql select * from dialplan; ++--++--++---+ ++---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---+ ++---+ | 1 |1 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---+ ++---+ 1 row in set (0.00 sec) and in script: $var(x) = sip:06; dp_translate(1, $var(x)/$var(tmp)); xlog(-$var(tmp)\n); The output was: Jun 16 03:22:34 [7921] DBG:dialplan:dp_get_ivalue: integer value Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: dpid is 1 Jun 16 03:22:34 [7921] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:translate: regex operator testing Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:translate: found a matching rule 0xb56744c0: pr 0, match_exp (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: input sip:06 with dpid 1 = output sip:061...@10.47.19.24 -sip:061...@10.47.19.24 Which looks pretty ok ... Maybe there is something something in the correct data in DB. Regards, Bogdan Bradley, Todd wrote: Hi, I'm new to openSIPS and am trying to set it up with the dialplan module, but I've had a couple problems I can't figure out. The first problem is related to how dp_translate is doing regexp replacements. I have code like this in my route method: if (is_method(INVITE)) { xlog(To user is: $tu\n); xlog(ruri.user is: $ruri.user\n); xlog(avp(s:dest) is: $avp(s:dest)\n); dp_translate(1, $tu/$var(tmp)); xlog(The variable that came out was $var(tmp)\n); setflag(1); # do accounting } And my dialplan DB table has this row for dpid 1: match_exp=(^06.+) subst_exp=(^06.+) repl_exp...@10.47.19.24 When I send in a SIP INVITE that is to sip:06, I expect the dp_translate to convert this to sip:061...@10.47.19.24. But I just get sip:06 back. Here's the output: To user is: sip:06 ruri.user is: null avp(s:dest) is: null Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_ivalue: integer value Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: dpid is 2 Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_svalue: searching 22 Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f
Re: [OpenSIPS-Users] my problems getting dialplan to work
This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan; ++--++--++---++- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++- ---+---+ | 7 |2 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---++- ---+---+ 1 row in set (0.00 sec) Any ideas? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 10:14 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, The attr column is not user in t matching / replacement process - it is a simply opaque string (with no special meaning) that will be automatically pushed into script (via some PV) if the rule matches. If this still does not work for you, please post the opensips log (like last one). Regards, Bogdan Bradley, Todd wrote: Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan; ++--++--++---++--- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++--- ++--++--++---++-- ---+---+ | 7 |2 | 2 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | | ++--++--++---++--- ++--++--++---++-- ---+---+ 1 row in set (0.00 sec) The only possibly relevant difference I see is that you have a 0 in your attrs column, where I have a blank. Otherwise, it looks like everything's fine, doesn't it? I couldn't figure out what the attrs column was for, so I didn't insert anything into it. According to the docs, it's a General attributes string to be returned in case of rule matching and it's a string. Could you help explain what it's for? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Monday, June 15, 2009 6:28 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Bradley, I re-made your case with: mysql select * from dialplan; ++--++--++---+ ++---+ | id | dpid | pr | match_op | match_exp
Re: [OpenSIPS-Users] my problems getting dialplan to work
Todd, this sounds like twilightzone :)...what OS are you using ? regards, Bogdan Bradley, Todd wrote: This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan; ++--++--++---++- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++- ---+---+ | 7 |2 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---++- ---+---+ 1 row in set (0.00 sec) Any ideas? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 10:14 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, The attr column is not user in t matching / replacement process - it is a simply opaque string (with no special meaning) that will be automatically pushed into script (via some PV) if the rule matches. If this still does not work for you, please post the opensips log (like last one). Regards, Bogdan Bradley, Todd wrote: Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan; ++--++--++---++--- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++--- ++--++--++---++-- ---+---+ | 7 |2 | 2 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | | ++--++--++---++--- ++--++--++---++-- ---+---+ 1 row in set (0.00 sec) The only possibly relevant difference I see is that you have a 0 in your attrs column, where I have a blank. Otherwise, it looks like everything's fine, doesn't it? I couldn't figure out what the attrs column was for, so I didn't insert anything into it. According to the docs, it's a General attributes string to be returned in case of rule matching and it's a string. Could you help explain what it's for? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Monday, June 15, 2009 6:28 PM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems
Re: [OpenSIPS-Users] my problems getting dialplan to work
I'm running on GNU/Linux FC7. I know that's pretty old, but it's updated with all the latest package updates. I built opensips-1.5.1-tls from source. Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 11:15 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Todd, this sounds like twilightzone :)...what OS are you using ? regards, Bogdan Bradley, Todd wrote: This is really baffling. I updated my DB table to look nearly exactly like yours and even changed my script to look almost exactly like yours, and still it doesn't work. Here's the output that was logged: Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_ivalue: integer value Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: dpid is 2 Jun 16 10:35:12 [27383] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: regex operator testing Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:translate: found a matching rule 0xb615a1f0: pr 0, match_exp (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:translate: the rule's attrs are 0 Jun 16 10:35:12 [27383] DBG:dialplan:translate: the copied attributes are: 0 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 10:35:12 [27383] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that went in was sip:06 The variable that came out was sip:06 And here is the relevant part of my route script: $var(x) = sip:06; dp_translate(2, $var(x)/$var(tmp)); xlog(The variable that went in was $var(x)\n); xlog(The variable that came out was $var(tmp)\n); And here is the data from my dialplan table: mysql select * from dialplan; ++--++--++---++--- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++--- ++--++--++---++-- ---+---+ | 7 |2 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---++--- ++--++--++---++-- ---+---+ 1 row in set (0.00 sec) Any ideas? Cheers, Todd. -Original Message- From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu Sent: Tuesday, June 16, 2009 10:14 AM To: Bradley, Todd Cc: users@lists.opensips.org Subject: Re: [OpenSIPS-Users] my problems getting dialplan to work Hi Todd, The attr column is not user in t matching / replacement process - it is a simply opaque string (with no special meaning) that will be automatically pushed into script (via some PV) if the rule matches. If this still does not work for you, please post the opensips log (like last one). Regards, Bogdan Bradley, Todd wrote: Thanks, Bogdan. At first I definitely had my repl_exp expression wrong due to the backslash being interpreted wrong. But I fixed that and I think it's right now. Here's what I get: mysql select * from dialplan; ++--++--++---++-- ++--++--++---++- ++--++--++---++-- ---+---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---++-- ++--++--++---++- ++--++--++---++-- ---+---+ | 7 |2 | 2 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24
[OpenSIPS-Users] my problems getting dialplan to work
Hi, I'm new to openSIPS and am trying to set it up with the dialplan module, but I've had a couple problems I can't figure out. The first problem is related to how dp_translate is doing regexp replacements. I have code like this in my route method: if (is_method(INVITE)) { xlog(To user is: $tu\n); xlog(ruri.user is: $ruri.user\n); xlog(avp(s:dest) is: $avp(s:dest)\n); dp_translate(1, $tu/$var(tmp)); xlog(The variable that came out was $var(tmp)\n); setflag(1); # do accounting } And my dialplan DB table has this row for dpid 1: match_exp=(^06.+) subst_exp=(^06.+) repl_exp...@10.47.19.24 When I send in a SIP INVITE that is to sip:06, I expect the dp_translate to convert this to sip:061...@10.47.19.24. But I just get sip:06 back. Here's the output: To user is: sip:06 ruri.user is: null avp(s:dest) is: null Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_ivalue: integer value Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: dpid is 2 Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_svalue: searching 22 Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: input is sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:translate: regex operator testing Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:translate: found a matching rule 0xb610c1f0: pr 2, match_exp (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that came out was sip:06 So it looks like \1 is indeed replaced with the part that matches the regexp, but the rest of my replacement string (the @10.47.19.24 part) is ignored. Why is that? What am I doing wrong? And my second question is this: Once I fix my first mistake, what should I do to make use of this? The behavior I want is that when the proxy gets an INVITE to 06, it fills in the rest of the address and then routes it along. In this case, it should pass it along to 061...@10.47.19.24. Here's where my newness to openSIPS is coming to light, I think. When I read the documentation for the dialplan module (http://www.opensips.org/html/docs/modules/1.5.x/dialplan.html), it has an example that leads me to believe I should be able to just do this: dp_translate(2, $avp(s:dest)/$avp(s:dest)); But $avp(s:dest) is null, as you can see from the output above. What SHOULD I have in my route script to do what I'm trying to do? Thanks, Todd. ps. I originally posted this question last week to the OpenSIPS web forum, but then realized that nobody really reads the forum and all the action is over here on the users email list. So sorry for the sort-of duplication. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] my problems getting dialplan to work
You know, first time I used the fantastic dialplan module it didn't work.. When I went back and did a select * from dialplan, I noticed that what was IN the table wasn't anything like what I put into the table. Seems that because of all the crazy PCRE symbols, there was quite a bit of escaping that needed to be done for it to get into the table properly. So, try that.. check the actual contents in the table and see if it's what is expected.. On Mon, Jun 15, 2009 at 7:27 PM, Bogdan-Andrei Iancu bog...@voice-system.ro wrote: Hi Bradley, I re-made your case with: mysql select * from dialplan; ++--++--++---+++---+ | id | dpid | pr | match_op | match_exp | match_len | subst_exp | repl_exp | attrs | ++--++--++---+++---+ | 1 |1 | 0 |1 | (sip:06.+) | 0 | (sip:06.+) | \...@10.47.19.24 | 0 | ++--++--++---+++---+ 1 row in set (0.00 sec) and in script: $var(x) = sip:06; dp_translate(1, $var(x)/$var(tmp)); xlog(-$var(tmp)\n); The output was: Jun 16 03:22:34 [7921] DBG:dialplan:dp_get_ivalue: integer value Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: dpid is 1 Jun 16 03:22:34 [7921] DBG:dialplan:dp_get_svalue: searching 78 Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: input is sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:translate: regex operator testing Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:translate: found a matching rule 0xb56744c0: pr 0, match_exp (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 16 03:22:34 [7921] DBG:dialplan:dp_translate_f: input sip:06 with dpid 1 = output sip:061...@10.47.19.24 sip%3a061...@10.47.19.24 -sip:061...@10.47.19.24 sip%3a061...@10.47.19.24 Which looks pretty ok ... Maybe there is something something in the correct data in DB. Regards, Bogdan Bradley, Todd wrote: Hi, I'm new to openSIPS and am trying to set it up with the dialplan module, but I've had a couple problems I can't figure out. The first problem is related to how dp_translate is doing regexp replacements. I have code like this in my route method: if (is_method(INVITE)) { xlog(To user is: $tu\n); xlog(ruri.user is: $ruri.user\n); xlog(avp(s:dest) is: $avp(s:dest)\n); dp_translate(1, $tu/$var(tmp)); xlog(The variable that came out was $var(tmp)\n); setflag(1); # do accounting } And my dialplan DB table has this row for dpid 1: match_exp=(^06.+) subst_exp=(^06.+) repl_exp...@10.47.19.24 When I send in a SIP INVITE that is to sip:06, I expect the dp_translate to convert this to sip:061...@10.47.19.24sip%3a061...@10.47.19.24. But I just get sip:06 back. Here's the output: To user is: sip:06 ruri.user is: null avp(s:dest) is: null Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_ivalue: integer value Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: dpid is 2 Jun 12 13:48:55 [29901] DBG:dialplan:dp_get_svalue: searching 22 Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: input is sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:translate: regex operator testing Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:translate: found a matching rule 0xb610c1f0: pr 2, match_exp (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test string sip:06 against a pattern (sip:06.+) Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[0] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:test_match: test_match:[1] sip:06 Jun 12 13:48:55 [29901] DBG:dialplan:dp_translate_f: input sip:06 with dpid 2 = output sip:06 The variable that came out was sip:06 So it looks like \1 is indeed replaced with the part that matches the regexp, but the rest of my replacement string (the @10.47.19.24 part) is ignored. Why is that? What am I doing wrong? And my second question is this: Once I fix my first mistake, what should I do to make use of this? The behavior I want is that when the proxy gets an INVITE to 06,