Re: [asterisk-users] Dial Plan - Routing via Caller ID

2012-04-12 Thread lists65
Ok thanks.  It seems when I add the /number it quits working and I didn’t know 
if it would be a 1.8 issue.  I will give it another try.

 

Thanks again.

 

 

 

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Warren Selby
Sent: Thursday, April 12, 2012 11:18 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

On Apr 11, 2012, at 5:40 PM, list...@gmail.com wrote:

 

And your examples should work for 1.8.10 correct?

 

 

I just typed those out really quick, so there may be some syntax errors, but 
generally yes they should all work with 1.8.x. 

 

--

Thanks,

Warren Selby, dCAP

 

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dial Plan - Routing via Caller ID

2012-04-11 Thread lists65
Here is an example.

 

Let's say that I want to send all calls to a context that would answer the
call via voicemail.

Let's say that I want to only right a SIP phone if calls cam from a
particular Area Code (maybe the Area Codes in your state).

Let's say that I would want to send calls from a particular A/C and certain
NNX's to a particular sales group.

 

Does that help define the purpose of directing calls *from* different Area
Codes and NNX's?

 

I wanted to come up with total control to do with an incoming call depended
upon *where* that call came from whether it be a whole A/C, A/C with
particular NNX's or even down to a particular A/C/NNX/number.

 

Hope that clarifies what I was looking help with.

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of John Kiniston
Sent: Thursday, April 05, 2012 1:53 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

 

On Thu, Apr 5, 2012 at 10:35 AM, list...@gmail.com wrote:


If I wanted to route a call from a particular DID and the CALLERID from a
specific A/C this doesn't seem to work for me:

exten = 614000/_702XXX,n,Goto(context1,s,1)
exten = 614000/614999,n,Goto(context2,s,1)
exten = 614000/614998,n,Goto(context3,s,1)
exten = 614000/614997,n,Dial(SIP/,25)


You are pretty close, I  think it's your priorities that are the problem.
When I use Ex Girl Friend Logic I write my extensions this way:

exten = 614000/614999,1,Goto(context2,s,1)
exten = 614000/614998,1,Goto(context3,s,1)
exten = 614000,1,Dial(SIP/,25)

I have never used a wildcard match like you are attempting to do with the
702 prefix but according to voip-info.org it should work

-- 
A human being should be able to change a diaper, plan an invasion, butcher a
hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate,
act alone, solve equations, analyze a new problem, pitch manure, program a
computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
---Heinlein

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dial Plan - Routing via Caller ID

2012-04-11 Thread lists65
Thank you, Chad.  I will check out that document now.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Chad Wallace
Sent: Thursday, April 05, 2012 2:02 PM
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

On Thu, 5 Apr 2012 13:35:51 -0400
list...@gmail.com wrote:

 If I wanted to route a call from a particular DID and the CALLERID 
 from a specific A/C this doesn't seem to work for me:
 
 exten = 614000/_702XXX,n,Goto(context1,s,1)
 exten = 614000/614999,n,Goto(context2,s,1)
 exten = 614000/614998,n,Goto(context3,s,1)
 exten = 614000/614997,n,Dial(SIP/,25)

I think the n's should all be 1's, like so:

exten = 614000/_702XXX,1,Goto(context1,s,1)
exten = 614000/614999,1,Goto(context2,s,1)
exten = 614000/614998,1,Goto(context3,s,1)
exten = 614000/614997,1,Dial(SIP/,25)

The 'n' priority is used for subsequent lines (after the first) in the same
extension, but the first one for each extension should be 1.


 I have seen examples where I could use a pattern like (not specifying 
 a Caller ID info, and that works fine):
 
 exten = _X!,n,Goto(context1,s,1)
 exten = _X!,n,Goto(context2,s,1)
 exten = _X!,n,Goto(context3,s,1)

I suggest you don't use _X! or _X. as a pattern, until you fully understand
the security risks.  In the asterisk-1.8 tarball, there's a file called
README-SERIOUSLY.bestpractices.txt that explains it all.
You should read that before you do anything.


 I am confused on how to use patterns.
 
 I would like to learn how I can take either DID and route the calls to 
 various contexts via the CallerID (which couild be the entire DID 
 number, an NPA only or an NPANXX.

You have an example for NPA only in the line that handles area code 702.

Similar for NPANXX:

exten = 614000/_614999,1,Goto(context,s,1)


This is all covered quite well on the voip-info wiki:

http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns
http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf



-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Thank you, Chad.  I will check out that document now.


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Dial Plan - Routing via Caller ID

2012-04-11 Thread lists65
 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Danny Nicholas
Sent: Wednesday, April 11, 2012 5:17 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

Although I'm a huge fan of ex-girlfriend logic, it's probably overkill for
this application.  Here is what I would suggest:

exten = _702.n,Goto(context1,s,1)
exten = _614.,n,Goto(context2,s,1)
exten = _614555.,n,Goto(context3,s,1)
exten = _.,n,Dial(SIP/,25)

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of
list...@gmail.com
Sent: Wednesday, April 11, 2012 4:11 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

Here is an example.

 

Let's say that I want to send all calls to a context that would answer the
call via voicemail.

Let's say that I want to only right a SIP phone if calls cam from a
particular Area Code (maybe the Area Codes in your state).

Let's say that I would want to send calls from a particular A/C and certain
NNX's to a particular sales group.

 

Does that help define the purpose of directing calls *from* different Area
Codes and NNX's?

 

I wanted to come up with total control to do with an incoming call depended
upon *where* that call came from whether it be a whole A/C, A/C with
particular NNX's or even down to a particular A/C/NNX/number.

 

Hope that clarifies what I was looking help with.

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of John Kiniston
Sent: Thursday, April 05, 2012 1:53 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

 

On Thu, Apr 5, 2012 at 10:35 AM, list...@gmail.com wrote:


If I wanted to route a call from a particular DID and the CALLERID from a
specific A/C this doesn't seem to work for me:

exten = 614000/_702XXX,n,Goto(context1,s,1)
exten = 614000/614999,n,Goto(context2,s,1)
exten = 614000/614998,n,Goto(context3,s,1)
exten = 614000/614997,n,Dial(SIP/,25)


You are pretty close, I  think it's your priorities that are the problem.
When I use Ex Girl Friend Logic I write my extensions this way:

exten = 614000/614999,1,Goto(context2,s,1)
exten = 614000/614998,1,Goto(context3,s,1)
exten = 614000,1,Dial(SIP/,25)

I have never used a wildcard match like you are attempting to do with the
702 prefix but according to voip-info.org it should work

-- 
A human being should be able to change a diaper, plan an invasion, butcher a
hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate,
act alone, solve equations, analyze a new problem, pitch manure, program a
computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
---Heinlein

 

 

 

Thanks, Danny.

 

I will give that a try.

 

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dial Plan - Routing via Caller ID

2012-04-11 Thread lists65
Hi Warren,

 

Thanks for the help.  I agree I like the AGI best.  I am not a programmer
and don't know the AGI piece but I would like to learn.  I will try your
first two examples and then attempt to do something with AGI.  I really like
the idea of using a database and keeping the dialplan as clean as possible.

 

Thanks very much.

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Warren Selby
Sent: Wednesday, April 11, 2012 5:47 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

On Wed, Apr 11, 2012 at 4:11 PM, list...@gmail.com wrote:

Here is an example.

 

Let's say that I want to send all calls to a context that would answer the
call via voicemail.

Let's say that I want to only right a SIP phone if calls cam from a
particular Area Code (maybe the Area Codes in your state).

Let's say that I would want to send calls from a particular A/C and certain
NNX's to a particular sales group.

 

Does that help define the purpose of directing calls *from* different Area
Codes and NNX's?



You've got a few ways you can do this:

1 - In the dialplan with ex-girlfriend logic.  You should be able to use
patterns with your ex-girlfriend logic matches, as so:

exten = 15558675309/_255NXX,1,Verbose(Calls to 867-5309 from area code
255 end up here)
exten = 15558675309/_256123,1,Verbose(Calls to 867-5309 from phone
numbers 256123 end up here)

etc.  

2 - In the dialplan with GotoIf logic:

exten = 15558675309,1,Verbose(Call from ${CALLERID(num)} to 867-5309)
exten = 15558675309,n,GotoIf($[${CALLERID(num):1:3}=255]?areacode255)
exten = 15558675309,n,GotoIf($[${CALLERID(num):1:6}=256123]?num256123)
exten = 15558675309,n(areacode255),Verbose(Calls to 867-5309 from area code
255 end up here)
exten = 15558675309,n(num256123),Verbose(Calls to 867-5309 from phone
numbers 256123 end up here)

etc.

3 - Outside the dialplan with an AGI that allows you many more conditional
logic choices (plus keeps your dialplan nice and clean):

exten = 15558675309,1,Verbose(Call from ${CALLERID(num)} to 867-5309)
 same = n,AGI(route_by_clid)

In your AGI, you'll be most interested in the agi_callerid environment
variable and you can control where the call goes next using the SET CONTEXT
and SET EXTENSION agi commands, or simply EXEC a GoTo command (either way
works).

Ultimately, I would go with the AGI option, because that then allows you to
do things like use a database to store your routing information, use case
statements, create routing loops, etc.  It's up to you though.  


-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dial Plan - Routing via Caller ID

2012-04-11 Thread lists65
And your examples should work for 1.8.10 correct?

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Warren Selby
Sent: Wednesday, April 11, 2012 5:47 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dial Plan - Routing via Caller ID

 

On Wed, Apr 11, 2012 at 4:11 PM, list...@gmail.com wrote:

Here is an example.

 

Let's say that I want to send all calls to a context that would answer the
call via voicemail.

Let's say that I want to only right a SIP phone if calls cam from a
particular Area Code (maybe the Area Codes in your state).

Let's say that I would want to send calls from a particular A/C and certain
NNX's to a particular sales group.

 

Does that help define the purpose of directing calls *from* different Area
Codes and NNX's?



You've got a few ways you can do this:

1 - In the dialplan with ex-girlfriend logic.  You should be able to use
patterns with your ex-girlfriend logic matches, as so:

exten = 15558675309/_255NXX,1,Verbose(Calls to 867-5309 from area code
255 end up here)
exten = 15558675309/_256123,1,Verbose(Calls to 867-5309 from phone
numbers 256123 end up here)

etc.  

2 - In the dialplan with GotoIf logic:

exten = 15558675309,1,Verbose(Call from ${CALLERID(num)} to 867-5309)
exten = 15558675309,n,GotoIf($[${CALLERID(num):1:3}=255]?areacode255)
exten = 15558675309,n,GotoIf($[${CALLERID(num):1:6}=256123]?num256123)
exten = 15558675309,n(areacode255),Verbose(Calls to 867-5309 from area code
255 end up here)
exten = 15558675309,n(num256123),Verbose(Calls to 867-5309 from phone
numbers 256123 end up here)

etc.

3 - Outside the dialplan with an AGI that allows you many more conditional
logic choices (plus keeps your dialplan nice and clean):

exten = 15558675309,1,Verbose(Call from ${CALLERID(num)} to 867-5309)
 same = n,AGI(route_by_clid)

In your AGI, you'll be most interested in the agi_callerid environment
variable and you can control where the call goes next using the SET CONTEXT
and SET EXTENSION agi commands, or simply EXEC a GoTo command (either way
works).

Ultimately, I would go with the AGI option, because that then allows you to
do things like use a database to store your routing information, use case
statements, create routing loops, etc.  It's up to you though.  


-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

2012-04-10 Thread lists65
-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Noah
Engelberth
Sent: Monday, April 09, 2012 9:52 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of
list...@gmail.com
Sent: Monday, April 09, 2012 8:34 PM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

I am not a programmer and I have learned so much from examples and the
list.
Perhaps someone could tell me what I am doing wrong in my example below:

I am getting the caller ID and caller name from my local POTS line and I
want to add it into a sql table.  I am trying with the following code but
the data never gets put into the table.

Can anyone correct my syntax and tell me what I am doing wrong?


[callerinfo]
exten = s,1,MYSQL(Connect connid localhost myuser mypassword cnam) exten
= s,n,MYSQL(Query resultid ${connid} INSERT INTO `calleridcapture`
(`number`,`name`) VALUES (${CALLERID(num)},${CALLERID(name)})
exten = s,n,MYSQL(Clear ${resultid})
exten = s,n,MYSQL(Disconnect ${connid}) exten = s,n,NoOp(Callerid Name
${CALLERID(name)}) exten = s,n,NoOp(Callerid Number  ${CALLERID(num)})


The NoOP does show the correct CALLERID name  number when I test it.  The
information just doesn't go into my calleridcapture table in the cnam
database.

Thanks very much for your help
Again I am not a programmer and I am sure my syntax is wrong.

This is Asterisk 1.8.10.0


As the previous two posters alluded, you need to encapsulate your values in
quotes.  I think you can get by without the backticks, not 100% sure as I've
converted from MYSQL to func_odbc.  If you're not going to go with Steve's
recommendation of AGI, I would highly recommend  switching from func_mysql
to func_odbc; func_odbc is much more straightforward in my opinion, and you
definitely get much better error messages within the CLI as you're watching
your code execute.  ofps.oreilly.com/titles/9780596517342/asterisk-DB.html
is a good resource for setting up odbc.

Noah


Thanks for your responses.

Well, the AGI piece sounds good, but again I am not a programmer but I
certainly will try and try to find some code that I could piece together and
try to make it work.

I will check out Oreilly's stuff, they always seem to have good books when
you are trying to learn something new.

Thanks again, I really appreciate your resonse.



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

2012-04-10 Thread lists65


-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Monday, April 09, 2012 9:43 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

On Mon, 9 Apr 2012, list...@gmail.com wrote:

 I am getting the caller ID and caller name from my local POTS line and 
 I want to add it into a sql table.  I am trying with the following 
 code but the data never gets put into the table.

 Can anyone correct my syntax and tell me what I am doing wrong?

 [callerinfo]
 exten = s,1,MYSQL(Connect connid localhost myuser mypassword cnam) 
 exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO 
 `calleridcapture`
 (`number`,`name`) VALUES (${CALLERID(num)},${CALLERID(name)})
 exten = s,n,MYSQL(Clear ${resultid})
 exten = s,n,MYSQL(Disconnect ${connid}) exten = s,n,NoOp(Callerid 
 Name  ${CALLERID(name)}) exten = s,n,NoOp(Callerid Number  
 ${CALLERID(num)})

 The NoOP does show the correct CALLERID name  number when I test it. 
 The information just doesn't go into my calleridcapture table in the 
 cnam database.

I'm just a 1.2 Luddite, but I am a reasonably skilled c programmer. I've
never used the mysql() application because it seems ugly, limited and
'hackish' to me.

If it were me, I'd code it up as an AGI in a 'real' language where you have
access to 'real' error codes and messages and you don't need a bunch of
quoting hocus-pocus. (Supposedly, the quoting nonsense has gotten better
since 1.2.)

You say you're not a programmer so that may not be an option for you -- but
you got this far :)

The first thing I'd do (aside from using verbose() instead of noop()) would
be to display the result from each step. If the connection is failing,
looking farther is pointless.

Don't you need to put single or double quotes around your individual values?
Change 'mysql' to 'echo' on your 'select' line and see if the statement is
valid at the MySQL command line.

Then, I'd drop the backticks in the 'hail-mary' hope that they are confusing
mysql() somehow.

Then, I'd crack open another beer and reach for a book on c or PHP or Perl.

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Thanks for your help and comments.  Again I am not a programmer but you did
give me some direction and I will see if I can find some examples that will
work for my needs.  I have seen AGI before and you are right it does seem to
work very well.

Thanks for your help and comments.  I hope to figure this out.  The SQL is
new to me but I really like the database stuff.





--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

2012-04-10 Thread lists65


-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Doug Lytle
Sent: Monday, April 09, 2012 9:26 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

list...@gmail.com wrote:
 exten =  s,n,MYSQL(Query resultid ${connid} INSERT INTO 
 `calleridcapture`
 (`number`,`name`) VALUES (${CALLERID(num)},${CALLERID(name)})


Here is an example of one of my inserts:

exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO Indianapolis set
phone=${CALLERID(number)} \, flag=YES \, note=Blacklisted by
Tele-Torture - ${TODAY})

Doug

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Thank you Doug.  I did see some examples with the \ but I was confused
because I thought you didn't have to do that with 1.8 (maybe I misread that
some where along the line).  I will look at your example and see if I can
adapt what I am doing to make it work for me.

I appreciate your help and comments as well.  That's what is so good about
this list, seems like there is always someone that can help.  I really like
this stuff, I wished that I had got into programming a long time ago so I
could start to understand syntax better.  I missed out when I didn't pick up
learning how to code.




--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] MYSQL INSERT QUESTION IN DIALPLAN

2012-04-09 Thread lists65
I am not a programmer and I have learned so much from examples and the list.
Perhaps someone could tell me what I am doing wrong in my example below:

I am getting the caller ID and caller name from my local POTS line and I
want to add it into a sql table.  I am trying with the following code but
the data never gets put into the table.

Can anyone correct my syntax and tell me what I am doing wrong?


[callerinfo]
exten = s,1,MYSQL(Connect connid localhost myuser mypassword cnam)
exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO `calleridcapture`
(`number`,`name`) VALUES (${CALLERID(num)},${CALLERID(name)})
exten = s,n,MYSQL(Clear ${resultid})
exten = s,n,MYSQL(Disconnect ${connid})
exten = s,n,NoOp(Callerid Name  ${CALLERID(name)})
exten = s,n,NoOp(Callerid Number  ${CALLERID(num)})


The NoOP does show the correct CALLERID name  number when I test it.  The
information just doesn't go into my calleridcapture table in the cnam
database.

Thanks very much for your help
Again I am not a programmer and I am sure my syntax is wrong.

This is Asterisk 1.8.10.0




--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Dial Plan - Routing via Caller ID

2012-04-05 Thread lists65
I am running Asterisk 1.8.10.1.

I am trying to set up some routing in my dial plans and having some issues
(the issue being that I don't quite understand all of the syntax and
patterns that can be used:

Examples: 

DID1 = 614000
DID2 = 614001
CNAME1 = 614999
CNAME2 = 614998
CNAME3 = 614997

context1
context2
context3



I have looked at several examples (patterns) and I am a little confused and
am looking to the list for guidance.
Assuming I have (2) two DIDs and I want to route incoming calls according to
the DID called and as well as the Caller ID various contexts.


If I wanted to route a call from a particular DID and the CALLERID from a
specific A/C this doesn't seem to work for me:

exten = 614000/_702XXX,n,Goto(context1,s,1)
exten = 614000/614999,n,Goto(context2,s,1)
exten = 614000/614998,n,Goto(context3,s,1)
exten = 614000/614997,n,Dial(SIP/,25)

I have seen examples where I could use a pattern like (not specifying a
Caller ID info, and that works fine):

exten = _X!,n,Goto(context1,s,1)
exten = _X!,n,Goto(context2,s,1)
exten = _X!,n,Goto(context3,s,1)


I am confused on how to use patterns.

I would like to learn how I can take either DID and route the calls to
various contexts via the CallerID (which couild be the entire DID number, an
NPA only or an NPANXX.

Could someone please give me an example on how to do this?

TIA


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] (no subject)

2008-01-01 Thread lists65
 

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users