Re: [OpenSIPS-Users] How To Ask Questions The Smart Way

2009-07-13 Thread Bradley, Todd
That seems like an awesome idea.  Model it after the Linux HOWTOs, and sprinkle 
in some screen captures and hyperlinks.
 



From: users-boun...@lists.opensips.org on behalf of Gordon Ross
Sent: Mon 7/13/2009 9:02 AM
To: users
Subject: Re: [OpenSIPS-Users] How To Ask Questions The Smart Way



On 13/07/2009 14:45, "Bradley, Todd"  wrote:
> The
> introductory-level documentation is weaker than average.  Even the "cookbooks"
> are written such that they only make sense if you're already an experienced
> administrator of the software.

I have to agree here. After my experiences of getting OpenSIPS to work, I'm
half thinking of knocking up a *very* basic intro to getting OpenSIPS up and
working - just a basic intro. (e.g. DB authentication, trivial LCR, maybe
trivial mediaproxy/NAT setup)

GTG


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] How To Ask Questions The Smart Way

2009-07-13 Thread Bradley, Todd
Who let in the troll?  Anonymous coward!

One thing I will say, though, as someone who has tried to learn enough OpenSIPS 
to use it and then posted to the email list for help: It is more difficult to 
ask intelligent questions about OpenSIPS than many open source tools out there, 
just because it's so difficult to get started.  The introductory-level 
documentation is weaker than average.  Even the "cookbooks" are written such 
that they only make sense if you're already an experienced administrator of the 
software.


Cheers,
Todd.


-Original Message-
From: users-boun...@lists.opensips.org 
[mailto:users-boun...@lists.opensips.org] On Behalf Of li...@grounded.net
Sent: Friday, July 10, 2009 5:34 AM
To: users
Subject: Re: [OpenSIPS-Users] How To Ask Questions The Smart Way

Bunch of self important blowhards, this is the only mailing list that acts this 
way!

On Fri, 10 Jul 2009 02:48:05 -0400 (EDT), Alex Balashov wrote:
> 
> 
> Thank you for posting this.  It is something that very, very often needs
> to be said and bears repeating.
> 
>> This a good read for those who show up on mailing lists without any
>> guidance about how to ask the right questions and then complain that
>> nobody answers their questions as they want.
>> 
>> http://www.catb.org/~esr/faqs/smart-questions.html
>> 
>> It was also a good read for me.
>> 
>> Regards,
>> Adrian
>> 
>> 
>> ___
>> Users mailing list
>> us...@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




___
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

2009-07-09 Thread Bradley, Todd
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
> >>>> 

Re: [OpenSIPS-Users] my problems getting dialplan to work

2009-06-19 Thread Bradley, Todd
[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 $va

Re: [OpenSIPS-Users] my problems getting dialplan to work

2009-06-17 Thread Bradley, Todd
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?
> > >

Re: [OpenSIPS-Users] my problems getting dialplan to work

2009-06-16 Thread Bradley, Todd
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 o

Re: [OpenSIPS-Users] my problems getting dialplan to work

2009-06-16 Thread Bradley, Todd
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.
> >
> >

Re: [OpenSIPS-Users] my problems getting dialplan to work

2009-06-16 Thread Bradley, Todd
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'

[OpenSIPS-Users] my problems getting dialplan to work

2009-06-15 Thread Bradley, Todd
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:  
avp(s:dest) is:  
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