[asterisk-users] How to invoke a binary file from the dial plan?

2015-06-02 Thread Rodrigo Pimenta Carvalho
Hi everyone.

I'm new with Asterisk and I have to create a dial plan that will invoke a 
binary code. That is, asterisk will execute a program in the same machine. How 
to do it?

Let me explain what I have to do:

In the project that I am currently working, there is smartphones, SIP servers 
and doors/gates to be unlocked remotely. When the user executes an application 
on his/her phone, it will presents a button to unlock a remote gate or door.
By  pressing such button, the application will send a SIP INVITE to the SIP 
server (Asterisk). In this moment, a existing dial plan should call an 
executable hosted in the current machine. In this case I need to know how to 
program my extensions.conf to let Asterisk invoke another software to me.
The another software is the one responsible for unlocking a gate or door.

So, how to codify my extensions.conf in order to make Asterisk invoke another 
software?
Is another better way (idea) to implement my project using Asterisk and SIP? If 
so, comment, please!

Any hint will be very helpful!

Best regards.

RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
-- 
_
-- 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] Forward loop protection...

2015-06-02 Thread Carlos Chavez
Ia had a server overload today because someone did a call forward 
to their own extension.  To do a call forward I write a key called CFWD 
with the extensión number and number to dial .  The main script tests if 
the key/value exists and dials the number stored in the database.  What 
is an easy way to prevent dumb people from creating a loop?


--
Telecomunicaciones Abiertas de México S.A. de C.V.
Carlos Chávez
+52 (55)9116-91161


--
_
-- 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] Forward loop protection...

2015-06-02 Thread Kevin Larsen
  Ia had a server overload today because someone did a call forward 
 to their own extension.  To do a call forward I write a key called CFWD 
 with the extensión number and number to dial .  The main script tests if 

 the key/value exists and dials the number stored in the database.  What 
 is an easy way to prevent dumb people from creating a loop?

Right after you have read the number to call forward to, compare it to the 
number you are call forwarding from. If it matches, play the user an error 
message and have them try again.

And no matter what you do, the dumb people will come up with more creative 
ways to tank your phone system. A large amount of my dialplan code is 
taking into account the stupid things they have done and handling it 
properly if they do it again. I swear, if you could harness their 
creativity for good you could solve the world's problems 10 times over.-- 
_
-- 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] How to invoke a binary file from the dial plan?

2015-06-02 Thread Kevin Larsen
 Hi everyone.
 
 I'm new with Asterisk and I have to create a dial plan that will 
 invoke a binary code. That is, asterisk will execute a program in 
 the same machine. How to do it?
 
 Let me explain what I have to do:
 
 In the project that I am currently working, there is smartphones, 
 SIP servers and doors/gates to be unlocked remotely. When the user 
 executes an application on his/her phone, it will presents a button 
 to unlock a remote gate or door.
 By  pressing such button, the application will send a SIP INVITE to 
 the SIP server (Asterisk). In this moment, a existing dial plan 
 should call an executable hosted in the current machine. In this 
 case I need to know how to program my extensions.conf to let 
 Asterisk invoke another software to me.
 The another software is the one responsible for unlocking a gate or 
door.
 
 So, how to codify my extensions.conf in order to make Asterisk 
 invoke another software?
 Is another better way (idea) to implement my project using Asterisk 
 and SIP? If so, comment, please!
 
 Any hint will be very helpful!

Look into the System() dialplan application. It will execute a command on 
the system for you. Be aware that it will execute it as the user your 
Asterisk instance is running as, so permissions can sometimes be a bit 
finicky to get correct. I do something similar to pop my gate open. It is 
using nc to make a connection to the device, but same general idea as what 
you are doing.-- 
_
-- 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] RES: How to invoke a binary file from the dial plan?

2015-06-02 Thread Kevin Larsen
 Ok. Thanks for the hint.
 
 But, what exactly is a System() dialplan application? Is it a kind
 of command that i can call in dial plan? 
 
 I will look for System() related to dial plans.

From the Asterisk CLI type:
core show application System

It will print out the syntax for the command. One of the easier dialplan 
applications. 

exten = 1234,1,System(echo This is a test  
/var/log/asterisk/test.txt)

That line would use the Linux echo command to place the text This is a 
test into a file named test.txt located in the /var/log/asterisk 
directory.-- 
_
-- 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] RES: How to invoke a binary file from the dial plan?

2015-06-02 Thread Rodrigo Pimenta Carvalho
Ok. Thanks for the hint.

But, what exactly is a System() dialplan application? Is it a kind of command 
that i can call in dial plan? 

I will look for System() related to dial plans.

Thanks.

RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979

De: asterisk-users-boun...@lists.digium.com 
[asterisk-users-boun...@lists.digium.com] em Nome de Kevin Larsen 
[kevin.lar...@pioneerballoon.com]
Enviado: terça-feira, 2 de junho de 2015 17:31
Para: Asterisk Users Mailing List - Non-Commercial Discussion
Assunto: Re: [asterisk-users] How to invoke a binary file from the dial plan?

 Hi everyone.

 I'm new with Asterisk and I have to create a dial plan that will
 invoke a binary code. That is, asterisk will execute a program in
 the same machine. How to do it?

 Let me explain what I have to do:

 In the project that I am currently working, there is smartphones,
 SIP servers and doors/gates to be unlocked remotely. When the user
 executes an application on his/her phone, it will presents a button
 to unlock a remote gate or door.
 By  pressing such button, the application will send a SIP INVITE to
 the SIP server (Asterisk). In this moment, a existing dial plan
 should call an executable hosted in the current machine. In this
 case I need to know how to program my extensions.conf to let
 Asterisk invoke another software to me.
 The another software is the one responsible for unlocking a gate or door.

 So, how to codify my extensions.conf in order to make Asterisk
 invoke another software?
 Is another better way (idea) to implement my project using Asterisk
 and SIP? If so, comment, please!

 Any hint will be very helpful!

Look into the System() dialplan application. It will execute a command on the 
system for you. Be aware that it will execute it as the user your Asterisk 
instance is running as, so permissions can sometimes be a bit finicky to get 
correct. I do something similar to pop my gate open. It is using nc to make a 
connection to the device, but same general idea as what you are doing.

-- 
_
-- 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] Results of security honeypot experiment - scraping for IP's/credentials ?

2015-06-02 Thread Michelle Dupuis
The results of a security experiment were published this week, in which an 
Asterisk PBX was set out in the wild to see who would attack it and how:


http://www.telium.ca/?honeypot1


What I find particularly interesting is that people/bots are scraping support 
websites looking for valid IP's of PBX's, and valid credentials!


A good reminder to everyone on this list to not publish the IP of their PBX's, 
or even account names (in postings) as they will be quickly targeted

-- 
_
-- 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] Forward loop protection...

2015-06-02 Thread dk
 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Kevin Larsen
Sent: Tuesday, June 2, 2015 4:09 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Forward loop protection...

 

  Ia had a server overload today because someone did a call forward 
 to their own extension.  To do a call forward I write a key called CFWD 
 with the extensión number and number to dial .  The main script tests if 
 the key/value exists and dials the number stored in the database.  What 
 is an easy way to prevent dumb people from creating a loop?

Right after you have read the number to call forward to, compare it to the
number you are call forwarding from. If it matches, play the user an error
message and have them try again. 

And no matter what you do, the dumb people will come up with more creative
ways to tank your phone system. A large amount of my dialplan code is taking
into account the stupid things they have done and handling it properly if
they do it again. I swear, if you could harness their creativity for good
you could solve the world's problems 10 times over.

 

The loop checking is a bit more challenging than that. If Bob forwards to
Fred and Fred forwards to Sue, all is well when Bob and Fred head out for a
beer. A little later, we’re in deep doo-do0 when Sue forwards to Bob. 

 

  --Don

 

-- 
_
-- 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] Forward loop protection...

2015-06-02 Thread SamyGo
Could this possibly mean that any person who has CF set should never be
available as CF Destination. Simple db entry/check can have this done.

On Tue, Jun 2, 2015 at 5:34 PM, d...@donkelly.biz wrote:





 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Kevin Larsen
 *Sent:* Tuesday, June 2, 2015 4:09 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] Forward loop protection...



   Ia had a server overload today because someone did a call forward
  to their own extension.  To do a call forward I write a key called CFWD
  with the extensión number and number to dial .  The main script tests if
  the key/value exists and dials the number stored in the database.  What
  is an easy way to prevent dumb people from creating a loop?

 Right after you have read the number to call forward to, compare it to the
 number you are call forwarding from. If it matches, play the user an error
 message and have them try again.

 And no matter what you do, the dumb people will come up with more creative
 ways to tank your phone system. A large amount of my dialplan code is
 taking into account the stupid things they have done and handling it
 properly if they do it again. I swear, if you could harness their
 creativity for good you could solve the world's problems 10 times over.



 The loop checking is a bit more challenging than that. If Bob forwards to
 Fred and Fred forwards to Sue, all is well when Bob and Fred head out for a
 beer. A little later, we’re in deep doo-do0 when Sue forwards to Bob.



   --Don



 --
 _
 -- 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

-- 
_
-- 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] Forward loop protection...

2015-06-02 Thread dk
 

 

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Kevin Larsen
Sent: Tuesday, June 2, 2015 5:12 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Forward loop protection...

 

 The loop checking is a bit more challenging than that. If Bob 
 forwards to Fred and Fred forwards to Sue, all is well when Bob and 
 Fred head out for a beer. A little later, we’re in deep doo-do0 when
 Sue forwards to Bob. 

 Could this possibly mean that any person who has CF set should never
 be available as CF Destination. Simple db entry/check can have this done. 

That just goes to show that the problem can get complex pretty quickly. Using 
the original example above, it might be that you want to allow the Bob to Fred 
to Sue forwards, but only stop it if the Sue to Bob link is established, thus 
creating the loop. I wonder if you could do some kind of recursive check where 
you follow each forward and if you ever come back around to a number you have 
already checked you know there is a loop. 

To reuse the example above, on the creation of the Bob to Fred forward, the 
database is checked to see if Fred has any forwards. He doesn't, so is at the 
end of the forwarding chain. Now Fred forwards to Sue. Again, she is at the end 
of the chain, so it is allowed. When Sue goes to forward to Bob, the check 
shows that Bob has a forward. Not a problem, but we create a temporary list 
that has Sue's number in it. Then we check the next stage of forwarding. Bob 
forwards to Fred. Fred's is checked against our temporary list and doesn't 
match, so we are still good. Bob's number is now added to the temporary list 
and we check the forward Fred has in place. Fred forward's to Sue. We check 
Sue's number against the temporary list and it does exist. Thus we have a loop 
detected and the forward can now be denied. 

I am guessing with the recursion involved you might want to do the check 
outside of Asterisk and pass the result back in. I will also state that I have 
not had to do this deep checking in the past, so these are just some initial 
thoughts on how I would start approaching the problem. Of course, this also 
assumes that Bob, Fred, and Sue are all on the same phone system. If you don't 
have a shared database to look at, the problem just got harder indeed. 

 

Classic Centrex forwarding required that the target party answer or that call 
forwarding is forced by repeating the attempt. If calls were provisionally 
forwarded and an attempt was made to complete a call from the forwarding party 
to the target, it wouldn’t be too challenging to see if the forwarded call ends 
up at the initiating extension. This would be effective even if there were 
multiple phone systems involved (if caller ID wasn’t messed with).

 

  --Don

 

 

-- 
_
-- 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] תשובה: Forward loop protection...

2015-06-02 Thread Israel Gottlieb
  We could probably parse the rdnis field to see if it that hop is on the list מאת: Kevin Larsenנשלח: יום רביעי, 3 ביוני 2015 01:11אל: Asterisk Users Mailing List - Non-Commercial Discussionהשב ל: Asterisk Users Mailing List - Non-Commercial Discussionנושא: Re: [asterisk-users] Forward loop protection... The loop checking is a bit more challenging
than that. If Bob 
 forwards to Fred and Fred forwards to Sue, all is well when Bob
and 
 Fred head out for a beer. A little later, we’re in deep doo-do0
when
 Sue forwards to Bob. 

 Could this possibly mean that any person who
has CF set should never
 be available as CF Destination. Simple db entry/check can have this
done.

That just goes to show that the problem can get complex
pretty quickly. Using the original example above, it might be that you
want to allow the Bob to Fred to Sue forwards, but only stop it if the
Sue to Bob link is established, thus creating the loop. I wonder if you
could do some kind of recursive check where you follow each forward and
if you ever come back around to a number you have already checked you know
there is a loop.

To reuse the example above, on the creation of the
Bob to Fred forward, the database is checked to see if Fred has any forwards.
He doesn't, so is at the end of the forwarding chain. Now Fred forwards
to Sue. Again, she is at the end of the chain, so it is allowed. When Sue
goes to forward to Bob, the check shows that Bob has a forward. Not a problem,
but we create a temporary list that has Sue's number in it. Then we check
the next stage of forwarding. Bob forwards to Fred. Fred's is checked against
our temporary list and doesn't match, so we are still good. Bob's number
is now added to the temporary list and we check the forward Fred has in
place. Fred forward's to Sue. We check Sue's number against the temporary
list and it does exist. Thus we have a loop detected and the forward can
now be denied.

I am guessing with the recursion involved you might
want to do the check outside of Asterisk and pass the result back in. I
will also state that I have not had to do this deep checking in the past,
so these are just some initial thoughts on how I would start approaching
the problem. Of course, this also assumes that Bob, Fred, and Sue are all
on the same phone system. If you don't have a shared database to look at,
the problem just got harder indeed.


-- 
_
-- 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] Forward loop protection...

2015-06-02 Thread Kevin Larsen
 The loop checking is a bit more challenging than that. If Bob 
 forwards to Fred and Fred forwards to Sue, all is well when Bob and 
 Fred head out for a beer. A little later, we’re in deep doo-do0 when
 Sue forwards to Bob. 

 Could this possibly mean that any person who has CF set should never
 be available as CF Destination. Simple db entry/check can have this 
done.

That just goes to show that the problem can get complex pretty quickly. 
Using the original example above, it might be that you want to allow the 
Bob to Fred to Sue forwards, but only stop it if the Sue to Bob link is 
established, thus creating the loop. I wonder if you could do some kind of 
recursive check where you follow each forward and if you ever come back 
around to a number you have already checked you know there is a loop.

To reuse the example above, on the creation of the Bob to Fred forward, 
the database is checked to see if Fred has any forwards. He doesn't, so is 
at the end of the forwarding chain. Now Fred forwards to Sue. Again, she 
is at the end of the chain, so it is allowed. When Sue goes to forward to 
Bob, the check shows that Bob has a forward. Not a problem, but we create 
a temporary list that has Sue's number in it. Then we check the next stage 
of forwarding. Bob forwards to Fred. Fred's is checked against our 
temporary list and doesn't match, so we are still good. Bob's number is 
now added to the temporary list and we check the forward Fred has in 
place. Fred forward's to Sue. We check Sue's number against the temporary 
list and it does exist. Thus we have a loop detected and the forward can 
now be denied.

I am guessing with the recursion involved you might want to do the check 
outside of Asterisk and pass the result back in. I will also state that I 
have not had to do this deep checking in the past, so these are just some 
initial thoughts on how I would start approaching the problem. Of course, 
this also assumes that Bob, Fred, and Sue are all on the same phone 
system. If you don't have a shared database to look at, the problem just 
got harder indeed.
-- 
_
-- 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] did i miss the memo on asterisk devel ?

2015-06-02 Thread Joshua Colp

sean darcy wrote:

I usually lurk on the asterisk devel list to see what's going on.

No posts for a week or two. Has the list moved ?


Nope - it's just been a quiet time.

--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com  www.asterisk.org

--
_
-- 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] did i miss the memo on asterisk devel ?

2015-06-02 Thread sean darcy

I usually lurk on the asterisk devel list to see what's going on.

No posts for a week or two. Has the list moved ?

sean


--
_
-- 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] Signaling incoming call

2015-06-02 Thread Luca Bertoncello
Kevin Larsen kevin.lar...@pioneerballoon.com schrieb:

 Look into Set(CALLERID(name)) and Set(CALLERID(num)) to manipulate the 
 caller id name and number that show up on the phone.

Hi Kevin!

Thanks! It works!
I can set the name of the line with CALLERID(name) and see the caller number,
too.
And, it the number is in the address book, I see the name, too.

Perfect!

Regards
Luca Bertoncello
(lucab...@lucabert.de)

-- 
_
-- 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] Signaling incoming call

2015-06-02 Thread Kevin Larsen
 Hi Kevin!
 
 Thanks! It works!
 I can set the name of the line with CALLERID(name) and see the caller 
number,
 too.
 And, it the number is in the address book, I see the name, too.
 
 Perfect!

Glad it worked for you. I usually leave the number untouched, but will 
manipulate the name to suite what I want. I have mulitple call queues, so 
for instance, for my helpdesk lines, I will do something like transform 
Name to HD:Name so that the person being called knows that the caller 
dialed the help desk number rather than their direct number. On people who 
work multiple queues, it is very handy so they can see at a glance what 
queue the caller is reaching.-- 
_
-- 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] did i miss the memo on asterisk devel ?

2015-06-02 Thread Richard Mudgett
On Tue, Jun 2, 2015 at 8:55 AM, Joshua Colp jc...@digium.com wrote:

 sean darcy wrote:

 I usually lurk on the asterisk devel list to see what's going on.

 No posts for a week or two. Has the list moved ?


 Nope - it's just been a quiet time.


Most of the activity on the dev-list was code reviews.  Those
have been put on their own list since Gerrit requries
code reviews for every branch.
asterisk-code-rev...@lists.digium.com

Richard
-- 
_
-- 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