Re: [asterisk-users] dialplan goto - bad priority

2021-09-06 Thread asterisk
On 9/6/2021 9:22 AM, marek wrote:
> hi,
>
> i have this dialplan
>
> [incoming]
> exten => _X./_+421X,1,noop(cut +421 from CALLER)
> exten => _X./_+421X,n,Set(CALLERID(num)=${CALLERID(num):4})
> exten => _X./_+421X,n,goto(${CONTEXT},${EXTEN},1)
> exten => _X.,1,noop(main block)
> exten => _X.,n,noop(main block #2)
> exten => _X.,n,Set(GWNAME=out)
>
> my problem is when call arrive with +421 so i want strip this example
> prefix from callerid
>
> then i expecting that call jump(goto) to the line
>
> exten => _X.,1,noop(main block)
>
> but it jumps to
>
> exten => _X.,n,Set(GWNAME=out)
>
> any idea of this behavior? 
That is the intended behavior. See
https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching#PatternMatching-MatchingonCallerID.

When you change the Caller ID and you are extension pattern matching on
that, the extension immediately changes. Thus, you will advance to the
next priority, but in a different extension. You never hit
goto(${CONTEXT},${EXTEN},1)  because as soon as you change the Caller
ID, it's not going to pattern match on that priority anymore. It's going
to fall back to the more general extension match, with the next priority.

A simple way to avoid this might be rewriting using a separate context:

[rewrite-421]
exten => _X!,1,NoOp(cut +421 from CALLER)
    same => n,Set(CALLERID(num)=${CALLERID(num):4})
    same => n,Goto(incoming,${EXTEN},1)

[incoming]
exten => _X./_+421X,1,Goto(rewrite-421,${EXTEN},1)
exten => _X.,1,noop(main block)
exten => _X.,n,noop(main block #2)
exten => _X.,n,Set(GWNAME=out)

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] dialplan goto - bad priority

2021-09-06 Thread marek

hi,

i have this dialplan

[incoming]
exten => _X./_+421X,1,noop(cut +421 from CALLER)
exten => _X./_+421X,n,Set(CALLERID(num)=${CALLERID(num):4})
exten => _X./_+421X,n,goto(${CONTEXT},${EXTEN},1)
exten => _X.,1,noop(main block)
exten => _X.,n,noop(main block #2)
exten => _X.,n,Set(GWNAME=out)

my problem is when call arrive with +421 so i want strip this example 
prefix from callerid


then i expecting that call jump(goto) to the line

exten => _X.,1,noop(main block)

but it jumps to

exten => _X.,n,Set(GWNAME=out)

any idea of this behavior?

Marek





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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Dialplan - using multiple AND or OR in set is it possible ?

2020-05-18 Thread John Kiniston
Use the ARRAY version of Set.

same = n,ExecIf($["A" = "B"]?Set(ARRAY(C,D)=1,2))

On Tue, Apr 21, 2020 at 3:56 AM Administrator  wrote:

> Hello,
>
> we want to use something like
>
> same = n,ExecIf($["A" = "B"]?Set(C=1) & Set(D=2) & ...)
>
> Problem is that result gives C=1) & Set(D=2) & ...
>
> Is there a possibility to use multiple AND or OR in such a way ?
>
> --
> Daniel
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users



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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Dialplan - using multiple AND or OR in set is it possible ?

2020-04-21 Thread Administrator


Le 21/04/2020 à 15:23, Antony Stone a écrit :

On Tuesday 21 April 2020 at 12:54:49, Administrator wrote:


Hello,

we want to use something like

same = n,ExecIf($["A" = "B"]?Set(C=1) & Set(D=2) & ...)

Problem is that result gives C=1) & Set(D=2) & ...

Is there a possibility to use multiple AND or OR in such a way ?

No, logical operators are for comparing True and False - they can't be used to
say "do multiple things".

I'd suggest two ways of doing what you need:

a) invert the test and change the ExecIf() to a GotoIf() which skips past the
next few lines, each of which has one of your Set() statements on it.

b) leave the logic as it is but change ExecIf() to GosubIf) and put the Set()
statements into a subroutine context.


Thanks for your reply. We had applied the second approach.

Regards

--
Daniel

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Dialplan - using multiple AND or OR in set is it possible ?

2020-04-21 Thread Antony Stone
On Tuesday 21 April 2020 at 12:54:49, Administrator wrote:

> Hello,
> 
> we want to use something like
> 
> same = n,ExecIf($["A" = "B"]?Set(C=1) & Set(D=2) & ...)
> 
> Problem is that result gives C=1) & Set(D=2) & ...
> 
> Is there a possibility to use multiple AND or OR in such a way ?

No, logical operators are for comparing True and False - they can't be used to 
say "do multiple things".

I'd suggest two ways of doing what you need:

a) invert the test and change the ExecIf() to a GotoIf() which skips past the 
next few lines, each of which has one of your Set() statements on it.

b) leave the logic as it is but change ExecIf() to GosubIf) and put the Set() 
statements into a subroutine context.


Regards,


Antony.

-- 
René Descartes walks in to a bar.
The barman asks him "Do you want a drink?"
Descartes says "I think not," and disappears.

   Please reply to the list;
 please *don't* CC me.

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] Dialplan - using multiple AND or OR in set is it possible ?

2020-04-21 Thread Administrator

Hello,

we want to use something like

same = n,ExecIf($["A" = "B"]?Set(C=1) & Set(D=2) & ...)

Problem is that result gives C=1) & Set(D=2) & ...

Is there a possibility to use multiple AND or OR in such a way ?

--
Daniel

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Dialplan reload from AMI

2019-04-20 Thread Telium Technical Support
Does reloading pbx_config ONLY reload the dialplan?  Or is something else 
reloaded too?

 

This sounds like a preferable way to do it

 

From: Ian McMaster [mailto:ian.mcmas...@gmail.com] 
Sent: Saturday, April 20, 2019 1:19 PM
Subject: Dialplan reload from AMI

 

Rather than

Action: Command

Command: dialplan reload

 

Prefer this:

 

Action: Reload

Module: pbx_config

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] dialplan reload not showing debug info even with debug on (ast 15.5)

2018-07-30 Thread Richard Mudgett
On Sun, Jul 29, 2018 at 10:04 AM, Jonathan H  wrote:

> OK, many thanks for that. Not sure I see the point of the change, but
> at least I can get the info back by changing
>
> console => notice,warning,error
> to
> console => notice,warning,error,debug
>
> That said, dialplan reload seems to show significantly fewer items
> than before. I've got loads of extensions, and it does indeed seem to
> reload them all, but only shows about 1/4 of them in the console when
> doing dialplan reload. Hmmm...
>
> Incidentally, just while I'm here, is there a particular reason that
> debug can only every be pushed higher when connecting to the console?
> it's always been the case since I started using Asterisk 3 years ago
> so I guess there's a reason, and I never questioned it before. I'm
> just curious!
> For example:
>
>
> asterisk -rvddd
> Core debug was 2 and is now 3.
>
> asterisk -rv
> Core debug was 3 and is now 4.
>
> asterisk -rvdd
> Core debug is still 4.
>
> asterisk -rvd
> Core debug is still 4.
>
> But it always respects "core set debug" in whichever direction of
> verbosity is required.
>

When you connect to a remote asterisk with the -r option, there are a couple
commands automatically sent every time.  These automatic commands tell
the remote asterisk what verbose and debug level you passed on the
command line.

core set verbose at least X silent
core set debug atleast X

That is why the debug level does not go down.  Another thing is that the
debug level
is global to the system.  Thus if you set the level in one connection it
affects all
connections including future ones.  The verbose level is per connection.

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] dialplan reload not showing debug info even with debug on (ast 15.5)

2018-07-29 Thread Jonathan H
OK, many thanks for that. Not sure I see the point of the change, but
at least I can get the info back by changing

console => notice,warning,error
to
console => notice,warning,error,debug

That said, dialplan reload seems to show significantly fewer items
than before. I've got loads of extensions, and it does indeed seem to
reload them all, but only shows about 1/4 of them in the console when
doing dialplan reload. Hmmm...

Incidentally, just while I'm here, is there a particular reason that
debug can only every be pushed higher when connecting to the console?
it's always been the case since I started using Asterisk 3 years ago
so I guess there's a reason, and I never questioned it before. I'm
just curious!
For example:


asterisk -rvddd
Core debug was 2 and is now 3.

asterisk -rv
Core debug was 3 and is now 4.

asterisk -rvdd
Core debug is still 4.

asterisk -rvd
Core debug is still 4.

But it always respects "core set debug" in whichever direction of
verbosity is required.

Thanks again!
On Sun, 29 Jul 2018 at 13:14, Richard Mudgett  wrote:
>
>
>
> On Sat, Jul 28, 2018 at 1:10 PM, Jonathan H  wrote:
>>
>> I've not needed to do a dialplan reload for a while, so I don't know
>> exactly which version is stopped working, but on 15.5, I'm not seeing
>> ANY debug info at any debug level.
>> So I'm not really sure how to find mistakes in the dialplan.  This is
>> all I get... how do I enable this debug mode to see the previous
>> behaviour? Thanks
>>
>> asterisk -rvd
>> (enters console)
>> dialplan reload
>> Dialplan reloaded.
>> [...]
>> -- pbx_config successfully loaded 125 contexts (enable debug for 
>> details).
>
>
> Many of those messages now go out as DEBUG level 1 messages.  You would
> need to enable those to go out to your console in logger.conf if they aren't 
> enabled.
> Or you need to look at one of the logging files (like full) that has debug 
> messages
> routed to it.
>
> https://issues.asterisk.org/jira/browse/ASTERISK-27084 is the issue that did 
> that
> which went out in v15.3.0 and is mentioned in the CHANGES file:
>
> Core
> --
>  * During dialplan reload log messages are produced for each context,
>extension and include.  These messages are no longer printed by the
>verbose loggers, they are now only logged as debug messages.
>
>
> Richard
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at: https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] dialplan reload not showing debug info even with debug on (ast 15.5)

2018-07-29 Thread Richard Mudgett
On Sat, Jul 28, 2018 at 1:10 PM, Jonathan H  wrote:

> I've not needed to do a dialplan reload for a while, so I don't know
> exactly which version is stopped working, but on 15.5, I'm not seeing
> ANY debug info at any debug level.
> So I'm not really sure how to find mistakes in the dialplan.  This is
> all I get... how do I enable this debug mode to see the previous
> behaviour? Thanks
>
> asterisk -rvd
> (enters console)
> dialplan reload
> Dialplan reloaded.
> [...]
> -- pbx_config successfully loaded 125 contexts (enable debug for
> details).
>

Many of those messages now go out as DEBUG level 1 messages.  You would
need to enable those to go out to your console in logger.conf if they
aren't enabled.
Or you need to look at one of the logging files (like full) that has debug
messages
routed to it.

https://issues.asterisk.org/jira/browse/ASTERISK-27084 is the issue that
did that
which went out in v15.3.0 and is mentioned in the CHANGES file:

Core
--
 * During dialplan reload log messages are produced for each context,
   extension and include.  These messages are no longer printed by the
   verbose loggers, they are now only logged as debug messages.


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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] dialplan reload not showing debug info even with debug on (ast 15.5)

2018-07-28 Thread Jonathan H
I've not needed to do a dialplan reload for a while, so I don't know
exactly which version is stopped working, but on 15.5, I'm not seeing
ANY debug info at any debug level.
So I'm not really sure how to find mistakes in the dialplan.  This is
all I get... how do I enable this debug mode to see the previous
behaviour? Thanks

asterisk -rvd
(enters console)
dialplan reload
Dialplan reloaded.
[...]
-- pbx_config successfully loaded 125 contexts (enable debug for details).

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Dialplan question: Variables in GoTo() ?

2016-03-10 Thread Steve Edwards

On Thu, 10 Mar 2016, A J Stiles wrote:


Can you use variables in the target of a GoTo() statement?


Yes. Here are a few examples from one of my dialplans:

; invalid template
[i](!)
exten = i,1,verbose(1,[${EXTEN}@${CONTEXT}])
exten = i,n,goto(${CONTEXT},s,1)

; look up (set) DNIS (DID) channel variables
exten = _x.,n,  goto(lookup-dnis,${EXTEN},1)

; dispatch to selected application
exten = _[123456],n,
goto(${PRODUCT-${EXTEN}-APPLICATION},s,1)

This particular dialplan uses the invalid template in around 30 contexts 
and 'goto(${CONTEXT},s,1)' about 15 times. Note that the last example 
'nests' the variable expansion -- a variable within a variable.


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

--
_
-- 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] Dialplan question: Variables in GoTo() ?

2016-03-10 Thread Joshua Colp

A J Stiles wrote:

I can't seem to find a definitive answer on this, and I really don't want to
risk breaking a production server to find out; so I am going to try asking this
here, and maybe anyone else in the same situation searching the archives
sometime in future will find the answer I get.

Can you use variables in the target of a GoTo() statement?

What I am specifically thinking of is this;

[from_some_source]
exten =>  s,1,AGI(look_up_stuff.agi,${CALLERID(num)},${EXTEN})
; this AGI script sets variables: next_context, next_ext, next_step
exten =>  s,n,GoTo(${next_context},${next_ext},${next_step})

Will this work?  Does Asterisk evaluate expressions like this, or does it
expect literals?


It most certainly will work. It evaluates on use.

--
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] Dialplan question: Variables in GoTo() ?

2016-03-10 Thread A J Stiles
I can't seem to find a definitive answer on this, and I really don't want to 
risk breaking a production server to find out; so I am going to try asking this 
here, and maybe anyone else in the same situation searching the archives 
sometime in future will find the answer I get.

Can you use variables in the target of a GoTo() statement?

What I am specifically thinking of is this;

[from_some_source]
exten => s,1,AGI(look_up_stuff.agi,${CALLERID(num)},${EXTEN})
; this AGI script sets variables: next_context, next_ext, next_step
exten => s,n,GoTo(${next_context},${next_ext},${next_step})

Will this work?  Does Asterisk evaluate expressions like this, or does it 
expect literals?


-- 
AJS

Note:  Originating address only accepts e-mail from list!  If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .

-- 
_
-- 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] dialplan contexts syntax and terminology

2015-02-21 Thread Mitul Limbani
This one specifically

http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/asterisk-DP-Basics-SECT-3.html#asterisk-DP-Basics-SECT-3.1
On 22-Feb-2015 11:13 AM, thufir hawat.thu...@gmail.com wrote:

 On Sun, 22 Feb 2015 08:32:26 +0530, Mitul Limbani wrote:

  READ READ READ 


 I know, I have the 4th edition and I've been reading it.  Personally, I
 find it more general than specific, but I'll go back through that
 chapter, absolutely.


 thanks,

 Thufir


 --
 _
 -- 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] dialplan contexts syntax and terminology

2015-02-21 Thread Mitul Limbani
READ READ READ 

http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/asterisk-DP-Basics.html



Regards,
Mitul Limbani,
Business Head,
Enterux Solutions Pvt. Ltd.
110 Reena Complex, Opp. Nathani Steel,
Vidyavihar (W), Mumbai - 400 086. India
http://www.enterux.com/
http://www.entvoice.com/
email: mi...@enterux.in
DID: +91-22-71967196
Cell: +91-9820332422


On Sun, Feb 22, 2015 at 8:25 AM, thufir hawat.thu...@gmail.com wrote:

 I'm looking into the dialplan specifics:

 tleilax:~ #
 tleilax:~ # cat /etc/asterisk/extensions.conf
 [general]
 static=yes
 writeprotect=no

 [globals]
 CONSOLE=Console/dsp ; Console interface for
 demo
 TRUNK=DAHDI/r1; Trunk interface
 TRUNKX=DAHDI/r2 ; 2nd trunk interface
 TRUNKIAX=IAX2/ASTtest1:test@10.10.10.16:4569; IAX trunk interface
 TRUNKIAX1=IAX2/ASTtest1:test@10.10.10.16:4569   ; IAX trunk interface
 TRUNKBINFONE=IAX2/111222:passw...@iax.binfone.com   ; IAX trunk
 interface
 SIPtrunk=SIP/1234:passw...@sip.provider.net ; SIP trunk

 #include extensions-vicidial.conf



 Firstly, what language or format is this? Bash script?

 the line #include ... what is this called? An include statement?

 The [globals] -- what's the terminology for this? It's a context?  And
 a context is a logical separation in the dialplan?  Is that, in any way,
 analogous to a function or method?

 Once you create your this logical separation, what's the syntax
 surrounding invoking a specific context?  For example:

 tleilax:~ #
 tleilax:~ # tail /etc/asterisk/extensions-vicidial.conf

 [vicidial-auto]
 exten = h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-
 NODEBUG-${HANGUPCAUSE}-${DIALSTATUS}-${DIALEDTIME}-
 ${ANSWEREDTIME})

 include = vicidial-auto-internal
 include = vicidial-auto-phones
 include = vicidial-auto-external


 ; END OF FILELast Forced System Reload: 2015-02-20 16:49:28
 tleilax:~ #


 when the above contexts are included, these contexts are declared within
 the extensions-vicidial.conf, meaning that when they're declared, they're
 not actually used/invoked/called **until** the actual include = foo
 syntax?


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

[asterisk-users] dialplan contexts syntax and terminology

2015-02-21 Thread thufir
I'm looking into the dialplan specifics:

tleilax:~ # 
tleilax:~ # cat /etc/asterisk/extensions.conf
[general]
static=yes
writeprotect=no

[globals]
CONSOLE=Console/dsp ; Console interface for 
demo
TRUNK=DAHDI/r1; Trunk interface
TRUNKX=DAHDI/r2 ; 2nd trunk interface
TRUNKIAX=IAX2/ASTtest1:test@10.10.10.16:4569; IAX trunk interface
TRUNKIAX1=IAX2/ASTtest1:test@10.10.10.16:4569   ; IAX trunk interface
TRUNKBINFONE=IAX2/111222:passw...@iax.binfone.com   ; IAX trunk 
interface
SIPtrunk=SIP/1234:passw...@sip.provider.net ; SIP trunk

#include extensions-vicidial.conf



Firstly, what language or format is this? Bash script?

the line #include ... what is this called? An include statement?

The [globals] -- what's the terminology for this? It's a context?  And 
a context is a logical separation in the dialplan?  Is that, in any way, 
analogous to a function or method?

Once you create your this logical separation, what's the syntax 
surrounding invoking a specific context?  For example:

tleilax:~ # 
tleilax:~ # tail /etc/asterisk/extensions-vicidial.conf 

[vicidial-auto]
exten = h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-
NODEBUG-${HANGUPCAUSE}-${DIALSTATUS}-${DIALEDTIME}-
${ANSWEREDTIME})

include = vicidial-auto-internal
include = vicidial-auto-phones
include = vicidial-auto-external


; END OF FILELast Forced System Reload: 2015-02-20 16:49:28
tleilax:~ # 


when the above contexts are included, these contexts are declared within 
the extensions-vicidial.conf, meaning that when they're declared, they're 
not actually used/invoked/called **until** the actual include = foo 
syntax?


-- 
_
-- 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] dialplan contexts syntax and terminology

2015-02-21 Thread thufir
On Sun, 22 Feb 2015 08:32:26 +0530, Mitul Limbani wrote:

 READ READ READ 


I know, I have the 4th edition and I've been reading it.  Personally, I 
find it more general than specific, but I'll go back through that 
chapter, absolutely.


thanks,

Thufir


-- 
_
-- 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] Dialplan for receiving faxes on Asterisk

2015-01-30 Thread Larry Moore


On 30/01/2015 1:25 PM, Simon Humbert wrote:

  Hi all,

It looks like people commonly use this kind of dialplan when receiving
faxes on Asterisk, with a jump to extension fax during the Wait() if a
fax tone is detected:

[start-here]
exten = _X.,1,Answer()
exten = _X.,n,Wait(n)
exten = _X.,n,...do stuff...
exten = _X.,n,Hangup()

exten = fax,1,Goto(fax-rx,receive,1)

[fax-rx]
exten = receive,1,...
exten = receive,n,...do stuff...
exten = receive,n,ReceiveFAX()

This is well suited in case Asterisk needs to receive both voice and fax
calls. But what if Asterisk is only used to receive fax calls, can we
start directly at the fax-rx context? I've heard that it's better to
wait a few seconds before calling ReceiveFAX(), is it still necessary in
case we don't actually need fax detection?



If you don't have the need to detect the fax tone then I don't see any 
need to wait.


You should disable the 'faxdetect' option in your peer otherwise it may 
attempt to redirect to the 'fax' extension upon detecting the fax 
signalling.


Assuming you are using a SIP trunk to accept the call you could use in 
your sip.conf peer something like;


context=fax-rx
disallow=all
allow=alaw,ulaw
jbenable=no
faxdetect=no
directmedia=no
callbackextension=receive
t38pt_usertpsource=yes
encryption=no

Note, in this example I am using 'callbackextension' instead of 
'register =', refer to the default sip.conf for further information.


Larry.

--
_
-- 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] Dialplan for receiving faxes on Asterisk

2015-01-29 Thread Simon Humbert
  Hi all,

It looks like people commonly use this kind of dialplan when receiving
faxes on Asterisk, with a jump to extension fax during the Wait() if a fax
tone is detected:

[start-here]
exten = _X.,1,Answer()
exten = _X.,n,Wait(n)
exten = _X.,n,...do stuff...
exten = _X.,n,Hangup()

exten = fax,1,Goto(fax-rx,receive,1)

[fax-rx]
exten = receive,1,...
exten = receive,n,...do stuff...
exten = receive,n,ReceiveFAX()

This is well suited in case Asterisk needs to receive both voice and fax
calls. But what if Asterisk is only used to receive fax calls, can we start
directly at the fax-rx context? I've heard that it's better to wait a few
seconds before calling ReceiveFAX(), is it still necessary in case we don't
actually need fax detection?

Simon
-- 
_
-- 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] dialplan reload context

2014-10-28 Thread Jonas Kellens

Hello,

is it possible to reload just a context in stead of the whole dialplan ?

I see this on the tracker : 
https://issues.asterisk.org/jira/browse/ASTERISK-19934


But is it possible in some Asterisk version ?




Kind regards,

Jonas.
-- 
_
-- 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] dialplan reload context

2014-10-28 Thread Scott Griepentrog
​Using current svn trunk, that option isn't available.  It would appear
that the patch from that issue did not get into the code.
​

On Tue, Oct 28, 2014 at 10:22 AM, Jonas Kellens jonas.kell...@telenet.be
wrote:

  Hello,

 is it possible to reload just a context in stead of the whole dialplan ?

 I see this on the tracker :
 https://issues.asterisk.org/jira/browse/ASTERISK-19934

 But is it possible in some Asterisk version ?




 Kind regards,

 Jonas.

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




-- 
[image: Digium logo]
Scott Griepentrog
Digium, Inc · Software Developer
445 Jan Davis Drive NW · Huntsville, AL 35806 · US
direct/fax: +1 256 428 6239 · mobile: +1 256 580 6090
Check us out at: http://digium.com · http://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

Re: [asterisk-users] dialplan reload context

2014-10-28 Thread Matthew Jordan
On Tue, Oct 28, 2014 at 10:54 AM, Scott Griepentrog sgriepent...@digium.com
 wrote:

 ​Using current svn trunk, that option isn't available.  It would appear
 that the patch from that issue did not get into the code.
 ​

 On Tue, Oct 28, 2014 at 10:22 AM, Jonas Kellens jonas.kell...@telenet.be
 wrote:

  Hello,

 is it possible to reload just a context in stead of the whole dialplan ?

 I see this on the tracker :
 https://issues.asterisk.org/jira/browse/ASTERISK-19934

 But is it possible in some Asterisk version ?


The issue is still open, so yes, the patch hasn't been merged yet.

If you'd like to help the process move forward faster with that
improvement, there are a few things you can do:
1. You can test out the patch on the lastest Asterisk trunk, and provide
feedback on the feature.
2. With the author's permission, you can post the patch for review to
Review Board [1].
3. Tests are always appreciated, particularly with new features that impact
highly critical parts of the code, such as the PBX core. Writing tests for
the feature will definitely help it get included faster [2].

[1] https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process
[2]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Test+Suite+Documentation

Matt



-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com  http://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] dialplan =how many concurrent calls

2014-07-10 Thread Rafael Visser
Hi guys.

Does somebody knows how to get the concurrent calls from the dial plan?

Or.

How can i control not to run more than n simultaneus agi applications?

Thanks in advance.
rv
-- 
_
-- 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] dialplan =how many concurrent calls

2014-07-10 Thread Asghar Mohammad
you can use GROUP and GROUP_COUNT

n,Set(GROUP()=aname)
n,GotoIf($[${GROUP_COUNT(aname)}  8]?${EXTEN},200)
200,Hangup


On Thu, Jul 10, 2014 at 3:24 PM, Rafael Visser visser.raf...@gmail.com
wrote:

 Hi guys.

 Does somebody knows how to get the concurrent calls from the dial plan?

 Or.

 How can i control not to run more than n simultaneus agi applications?

 Thanks in advance.
 rv

 --
 _
 -- 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] dialplan =how many concurrent calls

2014-07-10 Thread Rafael Visser
Works fine..
Thanks Asghar!
rv


2014-07-10 9:35 GMT-04:00 Asghar Mohammad asghar...@gmail.com:

 you can use GROUP and GROUP_COUNT

 n,Set(GROUP()=aname)
 n,GotoIf($[${GROUP_COUNT(aname)}  8]?${EXTEN},200)
 200,Hangup


 On Thu, Jul 10, 2014 at 3:24 PM, Rafael Visser visser.raf...@gmail.com
 wrote:

 Hi guys.

 Does somebody knows how to get the concurrent calls from the dial plan?

 Or.

 How can i control not to run more than n simultaneus agi applications?

 Thanks in advance.
 rv

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

-- 
_
-- 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] dialplan changes in middle of call

2014-05-27 Thread Henry Fernandes
Recently, I made a change to our dialplan and reloaded Asterisk.  To my 
surprise, the dialplan was reloaded for calls in progress.  This caused a 
problem because some of the dialplan changes affected some loops and this 
caused an infinite loop.

Is there a way to change this so that reloading Asterisk after a dialplan 
change affects new calls and not calls in progress?
-H

-- 
_
-- 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] dialplan changes in middle of call

2014-05-27 Thread Joshua Colp

Henry Fernandes wrote:

Kia ora,


Recently, I made a change to our dialplan and reloaded Asterisk. To my
surprise, the dialplan was reloaded for calls in progress. This caused a
problem because some of the dialplan changes affected some loops and
this caused an infinite loop.

Is there a way to change this so that reloading Asterisk after a
dialplan change affects new calls and not calls in progress?


Not without drastically changing the PBX core.

Cheers,

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


Re: [asterisk-users] Dialplan to reach external SIP phone

2014-04-02 Thread Salman Zafar
Hi,
If (the other phone is also registered on same asterisk)
  You just have to Dial(SIP/${EXTEN})
else
   You need a trunk, or route the call to that
equipment(VoIP server) where the other phone(s) is/are registered so that
you can bridge both channels. Here you have to Dial(SIP/${EXTEN}@Trunk-IP)
or you can create a trunk in sip.conf to route call out, and the receiving
side should then route the call to the destination phone.


Regards


On Wed, Apr 2, 2014 at 8:11 AM, Meadows Hoa meadows_...@yahoo.com wrote:

 If I have Asterisk setup with local SIP phones configured but need to call
 a SIP phone which is not local but actually on another VLAN, what would the
 dialplan need to look like?

 Could the Asterisk dialplan directly call a SIP phone which is not a local
 phone within its sip.conf and dialplan, if the Directory Number and IP is
 known (or host name)?

 Didn't plan on needing a SIP trunk so assuming this is possible anyway?

 Would Asterisk have to actually go over a SIP trunk to another call
 manager (which has that phone configured as a local phone)? Thinking there
 has to be another way?

 Any help would be appreciated. Thanks

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




-- 
Regards

M. Salman Zafar
VoIP Professional
-- 
_
-- 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] Dialplan to reach external SIP phone

2014-04-01 Thread Meadows Hoa
If I have Asterisk setup with local SIP phones configured but need to call a 
SIP phone which is not local but actually on another VLAN, what would the 
dialplan need to look like? 
 
Could the Asterisk dialplan directly call a SIP phone which is not a local 
phone within its sip.conf and dialplan, if the Directory Number and IP is known 
(or host name)? 
 
Didn't plan on needing a SIP trunk so assuming this is possible anyway? 
 
Would Asterisk have to actually go over a SIP trunk to another call manager 
(which has that phone configured as a local phone)? Thinking there has to be 
another way?
 
Any help would be appreciated. Thanks-- 
_
-- 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] Dialplan MySQL inserted ID

2013-08-21 Thread Gareth Blades

On 20/08/13 17:48, Gergo Csibra wrote:

can I echo this variable ?

Like : exten =  s,n,NoOp(${LAST_INSERT_ID()})

No, this is a mysql query, so:

exten =  s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET C1=${ARG1}, 
C2=${ARG2}, timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})
exten =  s,n,MYSQL(Query resultid ${connid} SELECT LAST_INSERT_ID())
exten =  s,n,NoOp(${resultid})

first is your original insert query, next you must read the
last_insert_id() mysql function with an other query, then you can
echo the resultid variable which contains the last inserted id.

I would be a bit concerned about doing this on a busy system. What would 
happen if one call inserted a value, a second call inserted a value and 
then the first call read the LAST_INSERT_ID? Would it get the wrong 
value back?


If you do it in AGI then each query can have its own database connection 
and so avoid this issue. If thats a problem use FastAGI and have a 
daemon running and use transactions or another method to avoid the issue.



--
_
-- 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] Dialplan MySQL inserted ID

2013-08-20 Thread Jonas Kellens

Hello,

how can I obtain the inserted ID after having inserted a row with 
MySQL in the dialplan ?


exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET 
C1=${ARG1}, C2=${ARG2}, 
timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})


I need to know the ID of the newly inserted row.



Kind regards,
Jonas.
--
_
-- 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] Dialplan MySQL inserted ID

2013-08-20 Thread Gareth Blades

On 20/08/13 14:53, Jonas Kellens wrote:

Hello,

how can I obtain the inserted ID after having inserted a row with 
MySQL in the dialplan ?


exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET 
C1=${ARG1}, C2=${ARG2}, 
timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})


I need to know the ID of the newly inserted row.


You could write an AGI script in something like php or perl and get it 
to write to the mysql database instead. It can then set a variable which 
the dialplan can pick up.


--
_
-- 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] Dialplan MySQL inserted ID

2013-08-20 Thread A J Stiles
On Tuesday 20 August 2013, Jonas Kellens wrote:
 Hello,
 
 how can I obtain the inserted ID after having inserted a row with
 MySQL in the dialplan ?
 
 exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET
 C1=${ARG1}, C2=${ARG2},
 timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})
 
 I need to know the ID of the newly inserted row.
 
 
 
 Kind regards,
 Jonas.

I'm not sure it's possible to do that using the simple MySQL interface 
provided within the dialplan.

Why not write an AGI script in your favourite language  (Perl, Python, PHP, 
Java all have AGI and MySQL bindings)  to perform the INSERT query for you?  
You can supply values for C1 and C2 easily enough; and have your AGI script 
return the insert ID in a channel variable.  (You could also return another 
channel variable indicating success or failure, if this is important.)

-- 
AJS

Answers come *after* questions.

--
_
-- 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] Dialplan MySQL inserted ID

2013-08-20 Thread Gergo Csibra
Tuesday, August 20, 2013, 5:47:24 PM, Gareth wrote:

 On 20/08/13 14:53, Jonas Kellens wrote:
 Hello,

 how can I obtain the inserted ID after having inserted a row with 
 MySQL in the dialplan ?

 exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET 
 C1=${ARG1}, C2=${ARG2}, 
 timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})

 I need to know the ID of the newly inserted row.

 You could write an AGI script in something like php or perl and get it 
 to write to the mysql database instead. It can then set a variable which 
 the dialplan can pick up.

meh...

SELECT LAST_INSERT_ID()

-- 
Best regards,
 Gergomailto:csi...@gmail.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] Dialplan MySQL inserted ID

2013-08-20 Thread Jonas Kellens

On 08/20/2013 06:03 PM, Gergo Csibra wrote:

Tuesday, August 20, 2013, 5:47:24 PM, Gareth wrote:


On 20/08/13 14:53, Jonas Kellens wrote:

Hello,

how can I obtain the inserted ID after having inserted a row with
MySQL in the dialplan ?

exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET
C1=${ARG1}, C2=${ARG2},
timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})

I need to know the ID of the newly inserted row.

You could write an AGI script in something like php or perl and get it
to write to the mysql database instead. It can then set a variable which
the dialplan can pick up.

meh...

SELECT LAST_INSERT_ID()



Hello,

can I echo this variable ?

Like : exten = s,n,NoOp(${LAST_INSERT_ID()})


Kind regards,

Jonas.


--
_
-- 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] Dialplan MySQL inserted ID

2013-08-20 Thread Chris Bagnall

On 20/8/13 5:00 pm, A J Stiles wrote:

Why not write an AGI script in your favourite language  (Perl, Python, PHP,
Java all have AGI and MySQL bindings)  to perform the INSERT query for you?


+1. It would also give you somewhere to perform sanity checks on your 
${ARGS} to avoid SQL injection attacks...


Kind regards,

Chris
--
This email is made from 100% recycled electrons

--
_
-- 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] Dialplan MySQL inserted ID

2013-08-20 Thread Gergo Csibra
Tuesday, August 20, 2013, 6:08:19 PM, Jonas wrote:

 On 08/20/2013 06:03 PM, Gergo Csibra wrote:
 Tuesday, August 20, 2013, 5:47:24 PM, Gareth wrote:

 On 20/08/13 14:53, Jonas Kellens wrote:
 Hello,

 how can I obtain the inserted ID after having inserted a row with
 MySQL in the dialplan ?

 exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET
 C1=${ARG1}, C2=${ARG2},
 timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})

 I need to know the ID of the newly inserted row.
 You could write an AGI script in something like php or perl and get it
 to write to the mysql database instead. It can then set a variable which
 the dialplan can pick up.
 meh...

 SELECT LAST_INSERT_ID()


 Hello,

 can I echo this variable ?

Like : exten = s,n,NoOp(${LAST_INSERT_ID()})

No, this is a mysql query, so:

exten = s,n,MYSQL(Query resultid ${connid} INSERT INTO myTable SET 
C1=${ARG1}, C2=${ARG2}, 
timestamp=${STRFTIME(${EPOCH},,%Y-%m-%d_%H:%M:%S)})
exten = s,n,MYSQL(Query resultid ${connid} SELECT LAST_INSERT_ID())
exten = s,n,NoOp(${resultid})

first is your original insert query, next you must read the
last_insert_id() mysql function with an other query, then you can
echo the resultid variable which contains the last inserted id.



-- 
Best regards,
 Gergomailto:csi...@gmail.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] + dialplan

2013-06-11 Thread Jonson Player
Hello Adam,

Thank you very much for your info.

Regards,
Jonson.

On Tue, Jun 11, 2013 at 12:34 AM, ad...@3a.hu wrote:

 Hi,


 On 06/10/2013 22:26, Jonson Player wrote:

 Some users of main use + instead of 00 for international dial. Is there
 any solution for this problem?


 swap the + sign to double zeros if your provider can't handle it

 ; normal 00 prefix
 exten = _00ZZXXX.,1,Macro(**beforealldials)
 exten = _00ZZXXX.,n,Dial(SIP/${**EXTEN}@${OUTGOING_LINE})
 exten = _00ZZXXX.,n,Hangup()

 ; swap + prefix to 00
 exten = _+ZZXXX.,1,Macro(**beforealldials)
 exten = _+ZZXXX.,n,Dial(SIP/00${**EXTEN:1}@${OUTGOING_LINE})
 exten = _+ZZXXX.,n,Hangup()

 regards
 adam



 --
 __**__**_
 -- 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-**usershttp://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

[asterisk-users] + dialplan

2013-06-10 Thread Jonson Player
Hello guys,

I looking for some dial plan which can mach on +xxx numbers instead of
00xxx numbers.
Some users of main use + instead of 00 for international dial. Is there any
solution for this problem?
As far as i readed in asterisk is some kind of replacement of characters in
dial plan command.
Could i use that for archiving this option?

Thank you for help.

Jonson.
--
_
-- 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] + dialplan

2013-06-10 Thread adamk

Hi,

On 06/10/2013 22:26, Jonson Player wrote:

Some users of main use + instead of 00 for international dial. Is there
any solution for this problem?


swap the + sign to double zeros if your provider can't handle it

; normal 00 prefix
exten = _00ZZXXX.,1,Macro(beforealldials)
exten = _00ZZXXX.,n,Dial(SIP/${EXTEN}@${OUTGOING_LINE})
exten = _00ZZXXX.,n,Hangup()

; swap + prefix to 00
exten = _+ZZXXX.,1,Macro(beforealldials)
exten = _+ZZXXX.,n,Dial(SIP/00${EXTEN:1}@${OUTGOING_LINE})
exten = _+ZZXXX.,n,Hangup()

regards
adam



--
_
-- 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] Dialplan reload not reloading everything

2013-04-23 Thread Brandon Mackie
Good morning,

We recently fell back to the most recent build of asterisk 1.8 down from 11.3 
and I believe we've crossed some sort of limit for 1.8. Our dialplan is 515723 
entries long with 6263 distinct contexts. Both are loaded realtime via odbc 
(mysql). Previously at the end of a dialplan reload we would get a summary of 
how long it took to reload everything. Now it just shows the last line that it 
loaded as seen below:

-- Registered extension context '4959_5095_0'; registrar: pbx_config
-- Including switch 'realtime/@' in context '4959_5095_0'
-- Registered extension context '4960_5096_0'; registrar: pbx_config
-- Including switch 'realtime/@' in context '4960_5096_0'
asterisk*CLI

I've tried turning on debug and there's no extra information. I tried running 
it from the command line with -rx and it says dialplan reloaded. Yet a bunch of 
the newest contexts aren't recognized (asterisk reports that they don't exist 
then call dies). I've confirmed they're in the database. The context it ends 
with is not always the same. Sometimes it's in the 3000 range and sometimes 
it's in the 4000s. Has anyone else seen this? Is there a maximum string length 
for the contexts or something that could be causing this?
--
_
-- 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] Dialplan reload not reloading everything

2013-04-23 Thread Rusty Newton
- Original Message -
 From: Brandon Mackie bmac...@awktane.com

 We recently fell back to the most recent build of asterisk 1.8 down
 from 11.3 and I believe we’ve crossed some sort of limit for 1.8.
 Our dialplan is 515723 entries long with 6263 distinct contexts.
 Both are loaded realtime via odbc (mysql).

That's a big dialplan!

snip

 I’ve tried turning on debug and there’s no extra information.

snip

How did you enable debug?

Did you follow the directions here? 

https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

If you can pastebin a log showing the end of the reload with 
WARNING,ERROR,NOTICE, plus VERBOSE and DEBUG turned up (try 5 or higher) then 
maybe there will be something interesting..

-- 
Rusty Newton 
OS Community Support Manager | Digium, Inc. | www.digium.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

[asterisk-users] Dialplan / check / tool

2013-02-18 Thread Thorsten Göllner

Hi,

I am wondering, if there is any tool available, which performs a check 
for suspicious entries in the dialplan. For example a non existing 
AGI-Script or a double assigned extension ike that:


[context]
exten = *100*,1,AGI(test_app.pl)
...
exten = 190,1,Answer()
...
exten = *100*,1,AGI(never_reached.pl)
...

A normal dialplan reload command would echo no warning or something 
similair.


Best regards
-Thorsten-
--
_
-- 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] Dialplan / check / tool

2013-02-18 Thread Carlos Alvarez
On Mon, Feb 18, 2013 at 8:11 AM, Thorsten Göllner t...@ovm-group.com wrote:


 A normal dialplan reload command would echo no warning or something
 similair.


The duplicated extension will cause an error.  Something like cannot add
extension in line X because it already exists.

-- 
Carlos Alvarez
TelEvolve
602-889-3003
--
_
-- 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] Dialplan / check / tool

2013-02-18 Thread Doug Lytle
 A normal dialplan reload command would echo no warning or something 
 similair. 


Normally I would see these being logged to /var/log/asterisk/messages with a 
stock Asterisk install. 

Doug 


-- 
Ben Franklin quote: 

Those who would give up Essential Liberty to purchase a little Temporary 
Safety, deserve neither Liberty nor Safety. 
--
_
-- 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] Dialplan / check / tool

2013-02-18 Thread Steve Edwards

On Mon, 18 Feb 2013, Thorsten Göllner wrote:

I am wondering, if there is any tool available, which performs a check 
for suspicious entries in the dialplan. For example a non existing 
AGI-Script...


I'm just a 1.2 Luddite, but none that I know of.

Please feel free to write one. Here are a few features that would be 
helpful:


) Parentheses, bracket, brace, quote, and double-quote matching.

) Parse /etc/init.d/asterisk to see if -C is used; parse asterisk.conf to 
see if astagidir is defined; take note of the username used to start 
Asterisk.


) Parse extensions.conf for global variables to cover the use case of:

exten = *,n, agi(${SOME-VARIABLE}/foo)

) Check the permissions of the AGI's path relative to the username and 
group that starts Asterisk. Warn if silly permissions like 777 are found.


) If the AGI is an interpreted script (Bash, Perl, PHP, Python, etc.) 
instead of a compiled executable (C, Fortran, Cobol, assembler, etc.) 
ensure that the interpreter is present and functional (maybe something 
like 'interpreter --version').


) Detect dialplan 'fall-through.'

) Detect 'gaps' in priorities. Note that priorities do not need to be 
contiguous or even specified in sequential order.


) Have a command line parameter to specify which version of Asterisk to 
check compliance against. This would be a great 'desk check' before 
migrating from 1.2 to 11 :)


) Detect global and channel variables defined, but not used.

) Detect global and channel variables used before defined.

) Detect missing goto targets.

Feel free to implement a subset of the above for your initial release :)

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

Re: [asterisk-users] Dialplan / check / tool

2013-02-18 Thread Christopher Harrington
On Mon, Feb 18, 2013 at 10:54 AM, Steve Edwards
asterisk@sedwards.comwrote:

 ) If the AGI is [...] a compiled executable (C, Fortran, Cobol, assembler,
 etc.)


I'd like to see an AGI written using Fortran or Cobol.


-- 
-Chris Harrington
ACSDi Office: 763.559.5800
Mobile Phone: 612.326.4248
--
_
-- 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] Dialplan / check / tool

2013-02-18 Thread Steven Howes
On 18 Feb 2013, at 17:03, Christopher Harrington wrote:
 On Mon, Feb 18, 2013 at 10:54 AM, Steve Edwards asterisk@sedwards.com 
 wrote:
 ) If the AGI is [...] a compiled executable (C, Fortran, Cobol, assembler, 
 etc.) 
 I'd like to see an AGI written using Fortran or Cobol. 

Don't tempt me ;)

S--
_
-- 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] Dialplan / check / tool

2013-02-18 Thread Steve Edwards

On Mon, 18 Feb 2013, Steven Howes wrote:


On 18 Feb 2013, at 17:03, Christopher Harrington wrote:
  On Mon, Feb 18, 2013 at 10:54 AM, Steve Edwards 
asterisk@sedwards.com wrote:
) If the AGI is [...] a compiled executable (C, Fortran, Cobol, 
assembler, etc.) 

  I'd like to see an AGI written using Fortran or Cobol. 

Don't tempt me ;)


I ate the apple before Eve...

program jwb
print*, 'verbose Welcome to 1957'
read(*,*)
end program jwb

It violates the AGI protocol (doesn't read the AGI variables) but it does 
execute correctly.


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

Re: [asterisk-users] Dialplan - working out when users answer

2013-01-08 Thread Andrew White
Hey Satish,

I've worked this out. I'm sorry, you were completely right and the context is 
fine. I was testing without answering the call, so the Dial was never 
connected! Doh!

Thanks heaps for your help, it's all working perfectly.

Cheers,

Andrew

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Satish Barot
Sent: Tuesday, 8 January 2013 12:00 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan - working out when users answer

HI Andrew,
Show your queuecontrol context. You should have  extension s with priority 1 in 
this context.
--Satish Barot

On Mon, Jan 7, 2013 at 12:08 PM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hi Satish,

Thanks for your response - sorry on the slow reply.

So I've tried the following in the dialplan:

exten = 
direct,n,Dial(${QUEUEEXTS},${RINGTIME},U(queueControl,direct^CONNECTED))

This has a very strange behavior - the NoOp that is in 
queueControl,direct,n(CONNECTED) does not show up, however I get the following:

[2013-01-07 17:31:39] ERROR[19135]: app_stack.c:420 gosub_exec: Attempt to 
reach a non-existent destination for gosub: (Context:queueControl, Extension:s, 
Priority:1)

I've also tried with a macro:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME},M(inboundconnected))
[macro-inboundconnected]
exten = s,1,NoOp(Inbound connected!)

It definitely seems like it's being called, but again no NoOp:

-- Executing [direct@queueControl:11] Dial(SIP/1000-47f1, 
SIP/1000,20,M(inboundconnected)) in new stack

I would expect some kind of error if I was doing this wrong - have I missed 
something?

Thanks for your or anyone elses help in advance!

Andrew


To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan - working out when users answer

On Wed, Dec 19, 2012 at 12:44 PM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hi Satish/list,

Looks like I spoke to soon.

I have the following in my dialplan:

Dial(${QUEUEEXTS},${RINGTIME},U(queueControl^direct^CONNECTED))

And after confirming with a dialplan show it was definitely in there, I 
continued to get this:

ERROR[28167]: app_stack.c:420 gosub_exec: Attempt to reach a non-existent 
destination for gosub: (Context:queueControl, Extension:s, Priority:1)

I can't quite work out why it would be trying to s/1 instead of 
direct/CONNECTED =/.

Any ideas?

Thanks!
In your case, direct and CONNECTED have to be arguments and not the extension 
and priority value respectively. Calling Subroutine from dial will always start 
execution with extension s and priority 1.
See the link for more information, Arguments are passed to subroutine using ^ 
as a delimiter.

--Satish Barot



To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: RE: [asterisk-users] Dialplan - working out when users answer

Thanks Satish, fantastic advice. I didn't even think to look into the dial 
options - doh!

Thanks very much,

Andrew


On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hey guys,

I've got a part of my dialplan that dials multiple people:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

Multiple extensions are in the ${QUEUEEXTS} from an external script - e.g. 
SIP/100SIP/101SIP/105 etc

This works great, however I want to see if I can find a way to work out (and 
run an AGI script) when the call is picked up by someone.

Thanks all!

Option M or U of Dial application would help you do this.
https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

--Satish Barot

--
_
-- 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] Dialplan - working out when users answer

2013-01-07 Thread Satish Barot
HI Andrew,
Show your queuecontrol context. You should have  extension s with priority
1 in this context.
--Satish Barot


On Mon, Jan 7, 2013 at 12:08 PM, Andrew White and...@computersforall.com.au
 wrote:

  Hi Satish,

 ** **

 Thanks for your response – sorry on the slow reply.

 ** **

 So I’ve tried the following in the dialplan:

 ** **

 exten =
 direct,n,Dial(${QUEUEEXTS},${RINGTIME},U(queueControl,direct^CONNECTED))**
 **

 ** **

 This has a very strange behavior – the NoOp that is in
 queueControl,direct,n(CONNECTED) does not show up, however I get the
 following:

 ** **

 *[2013-01-07 17:31:39] ERROR[19135]: app_stack.c:420 gosub_exec: Attempt
 to reach a non-existent destination for gosub: (Context:queueControl,
 Extension:s, Priority:1)*

 ** **

 I’ve also tried with a macro:

 ** **

 exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME},M(inboundconnected))

 [macro-inboundconnected]

 exten = s,1,NoOp(Inbound connected!)

 ** **

 It definitely seems like it’s being called, but again no NoOp:

 ** **

 *-- Executing [direct@queueControl:11] Dial(SIP/1000-47f1,
 SIP/1000,20,M(inboundconnected)) in new stack*

 * *

 I would expect some kind of error if I was doing this wrong – have I
 missed something?

 ** **

 Thanks for your or anyone elses help in advance!

 ** **

 Andrew

 * *


 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] Dialplan - working out when users answer**
 **

 ** **

 On Wed, Dec 19, 2012 at 12:44 PM, Andrew White 
 and...@computersforall.com.au wrote:

  Hi Satish/list,

  

 Looks like I spoke to soon.

  

 I have the following in my dialplan:

  

 *Dial(${QUEUEEXTS},${RINGTIME},U(queueControl^direct^CONNECTED))*

  

 And after confirming with a “dialplan show” it was definitely in there, I
 continued to get this:

  

 *ERROR[28167]: app_stack.c:420 gosub_exec: Attempt to reach a
 non-existent destination for gosub: (Context:queueControl, Extension:s,
 Priority:1)*

 * *

 I can’t quite work out why it would be trying to s/1 instead of
 direct/CONNECTED =/.

  

 Any ideas?

  

 Thanks!

  In your case, direct and CONNECTED have to be arguments and not the
 extension and priority value respectively. Calling Subroutine from dial
 will always start execution with extension s and priority 1.

 See the link for more information, Arguments are passed to subroutine
 using ^ as a delimiter.

 ** **

 --Satish Barot

  

   


 *To:* Asterisk Users Mailing List - Non-Commercial Discussion

 *Subject:* RE: [asterisk-users] Dialplan - working out when users answer**
 **

  

 Thanks Satish, fantastic advice. I didn’t even think to look into the dial
 options – doh!

  

 Thanks very much,

  

 Andrew


  

 On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
 and...@computersforall.com.au wrote:

  Hey guys,

  

 I’ve got a part of my dialplan that dials multiple people:

  

 *exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

 *Multiple extensions are in the ${QUEUEEXTS} from an external script –
 e.g. SIP/100SIP/101SIP/105 etc

  

 This works great, however I want to see if I can find a way to work out
 (and run an AGI script) when the call is picked up by someone.

  

 Thanks all!

  

  Option M or U of Dial application would help you do this.

 https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

  

 --Satish Barot



--
_
-- 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] Dialplan - working out when users answer

2013-01-06 Thread Andrew White
Hi Satish,

Thanks for your response - sorry on the slow reply.

So I've tried the following in the dialplan:

exten = 
direct,n,Dial(${QUEUEEXTS},${RINGTIME},U(queueControl,direct^CONNECTED))

This has a very strange behavior - the NoOp that is in 
queueControl,direct,n(CONNECTED) does not show up, however I get the following:

[2013-01-07 17:31:39] ERROR[19135]: app_stack.c:420 gosub_exec: Attempt to 
reach a non-existent destination for gosub: (Context:queueControl, Extension:s, 
Priority:1)

I've also tried with a macro:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME},M(inboundconnected))
[macro-inboundconnected]
exten = s,1,NoOp(Inbound connected!)

It definitely seems like it's being called, but again no NoOp:

-- Executing [direct@queueControl:11] Dial(SIP/1000-47f1, 
SIP/1000,20,M(inboundconnected)) in new stack

I would expect some kind of error if I was doing this wrong - have I missed 
something?

Thanks for your or anyone elses help in advance!

Andrew


From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Satish Barot
Sent: Wednesday, 19 December 2012 7:32 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan - working out when users answer

On Wed, Dec 19, 2012 at 12:44 PM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hi Satish/list,

Looks like I spoke to soon.

I have the following in my dialplan:

Dial(${QUEUEEXTS},${RINGTIME},U(queueControl^direct^CONNECTED))

And after confirming with a dialplan show it was definitely in there, I 
continued to get this:

ERROR[28167]: app_stack.c:420 gosub_exec: Attempt to reach a non-existent 
destination for gosub: (Context:queueControl, Extension:s, Priority:1)

I can't quite work out why it would be trying to s/1 instead of 
direct/CONNECTED =/.

Any ideas?

Thanks!
In your case, direct and CONNECTED have to be arguments and not the extension 
and priority value respectively. Calling Subroutine from dial will always start 
execution with extension s and priority 1.
See the link for more information, Arguments are passed to subroutine using ^ 
as a delimiter.

--Satish Barot


From: Andrew White
Sent: Wednesday, 19 December 2012 5:58 PM

To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: RE: [asterisk-users] Dialplan - working out when users answer

Thanks Satish, fantastic advice. I didn't even think to look into the dial 
options - doh!

Thanks very much,

Andrew

From: 
asterisk-users-boun...@lists.digium.commailto:asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Satish Barot
Sent: Wednesday, 19 December 2012 4:40 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan - working out when users answer

On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hey guys,

I've got a part of my dialplan that dials multiple people:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

Multiple extensions are in the ${QUEUEEXTS} from an external script - e.g. 
SIP/100SIP/101SIP/105 etc

This works great, however I want to see if I can find a way to work out (and 
run an AGI script) when the call is picked up by someone.

Thanks all!

Option M or U of Dial application would help you do this.
https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

--Satish Barot

--
_
-- 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] Dialplan - working out when users answer

2012-12-19 Thread Satish Barot
On Wed, Dec 19, 2012 at 12:44 PM, Andrew White 
and...@computersforall.com.au wrote:

  Hi Satish/list,

 ** **

 Looks like I spoke to soon.

 ** **

 I have the following in my dialplan:

 ** **

 *Dial(${QUEUEEXTS},${RINGTIME},U(queueControl^direct^CONNECTED))*

 ** **

 And after confirming with a “dialplan show” it was definitely in there, I
 continued to get this:

 ** **

 *ERROR[28167]: app_stack.c:420 gosub_exec: Attempt to reach a
 non-existent destination for gosub: (Context:queueControl, Extension:s,
 Priority:1)*

 * *

 I can’t quite work out why it would be trying to s/1 instead of
 direct/CONNECTED =/.

 ** **

 Any ideas?

 ** **

 Thanks!

In your case, direct and CONNECTED have to be arguments and not the
extension and priority value respectively. Calling Subroutine from dial
will always start execution with extension s and priority 1.
See the link for more information, Arguments are passed to subroutine using
^ as a delimiter.

--Satish Barot


 

 ** **

 *From:* Andrew White
 *Sent:* Wednesday, 19 December 2012 5:58 PM

 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* RE: [asterisk-users] Dialplan - working out when users answer**
 **

  ** **

 Thanks Satish, fantastic advice. I didn’t even think to look into the dial
 options – doh!

 ** **

 Thanks very much,

 ** **

 Andrew

 ** **

 *From:* asterisk-users-boun...@lists.digium.com [
 mailto:asterisk-users-boun...@lists.digium.comasterisk-users-boun...@lists.digium.com]
 *On Behalf Of *Satish Barot
 *Sent:* Wednesday, 19 December 2012 4:40 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] Dialplan - working out when users answer**
 **

 ** **

 On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
 and...@computersforall.com.au wrote:

  Hey guys,

  

 I’ve got a part of my dialplan that dials multiple people:

  

 *exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

 *Multiple extensions are in the ${QUEUEEXTS} from an external script –
 e.g. SIP/100SIP/101SIP/105 etc

  

 This works great, however I want to see if I can find a way to work out
 (and run an AGI script) when the call is picked up by someone.

  

 Thanks all!

  

  Option M or U of Dial application would help you do this.

 https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

 ** **

 --Satish Barot

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

[asterisk-users] Dialplan - working out when users answer

2012-12-18 Thread Andrew White
Hey guys,

I've got a part of my dialplan that dials multiple people:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

Multiple extensions are in the ${QUEUEEXTS} from an external script - e.g. 
SIP/100SIP/101SIP/105 etc

This works great, however I want to see if I can find a way to work out (and 
run an AGI script) when the call is picked up by someone.

Thanks all!

--
_
-- 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] Dialplan - working out when users answer

2012-12-18 Thread Satish Barot
On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
and...@computersforall.com.au wrote:

  Hey guys,

 ** **

 I’ve got a part of my dialplan that dials multiple people:

 ** **

 *exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

 *Multiple extensions are in the ${QUEUEEXTS} from an external script –
 e.g. SIP/100SIP/101SIP/105 etc

 ** **

 This works great, however I want to see if I can find a way to work out
 (and run an AGI script) when the call is picked up by someone.

 ** **

 Thanks all!

 ** **

Option M or U of Dial application would help you do this.
https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

--Satish Barot
--
_
-- 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] Dialplan - working out when users answer

2012-12-18 Thread Andrew White
Thanks Satish, fantastic advice. I didn't even think to look into the dial 
options - doh!

Thanks very much,

Andrew

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Satish Barot
Sent: Wednesday, 19 December 2012 4:40 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan - working out when users answer

On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hey guys,

I've got a part of my dialplan that dials multiple people:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

Multiple extensions are in the ${QUEUEEXTS} from an external script - e.g. 
SIP/100SIP/101SIP/105 etc

This works great, however I want to see if I can find a way to work out (and 
run an AGI script) when the call is picked up by someone.

Thanks all!

Option M or U of Dial application would help you do this.
https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

--Satish Barot
--
_
-- 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] Dialplan - working out when users answer

2012-12-18 Thread Andrew White
Hi Satish/list,

Looks like I spoke to soon.

I have the following in my dialplan:

Dial(${QUEUEEXTS},${RINGTIME},U(queueControl^direct^CONNECTED))

And after confirming with a dialplan show it was definitely in there, I 
continued to get this:

ERROR[28167]: app_stack.c:420 gosub_exec: Attempt to reach a non-existent 
destination for gosub: (Context:queueControl, Extension:s, Priority:1)

I can't quite work out why it would be trying to s/1 instead of 
direct/CONNECTED =/.

Any ideas?

Thanks!

From: Andrew White
Sent: Wednesday, 19 December 2012 5:58 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: RE: [asterisk-users] Dialplan - working out when users answer

Thanks Satish, fantastic advice. I didn't even think to look into the dial 
options - doh!

Thanks very much,

Andrew

From: 
asterisk-users-boun...@lists.digium.commailto:asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Satish Barot
Sent: Wednesday, 19 December 2012 4:40 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan - working out when users answer

On Wed, Dec 19, 2012 at 10:53 AM, Andrew White 
and...@computersforall.com.aumailto:and...@computersforall.com.au wrote:
Hey guys,

I've got a part of my dialplan that dials multiple people:

exten = direct,n,Dial(${QUEUEEXTS},${RINGTIME})

Multiple extensions are in the ${QUEUEEXTS} from an external script - e.g. 
SIP/100SIP/101SIP/105 etc

This works great, however I want to see if I can find a way to work out (and 
run an AGI script) when the call is picked up by someone.

Thanks all!

Option M or U of Dial application would help you do this.
https://wiki.asterisk.org/wiki/display/AST/Application_Dial.

--Satish Barot
--
_
-- 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] dialplan reloading

2012-11-02 Thread Danilo Dionisi

Hi Jerry,
From the Asterisk CLI, enter the command core restart when 
convenient, this command will restart asterisk only when there is no 
incoming call, and when it will close all outgoing calls.
With a restart of asterisk should reload all the information: 
extensions, sip, agi, iax, voicemail, etc.


Danilo

Il 01/11/12 23:30, Jerry Geis ha scritto:

If I issue a dialplan reload and some AGI starts as its reloading
and directs something into the diaplan that is still reloading

what happens

I presume my context is not there?

What I see is the diaplan is messed up somehow and I goto the default 
context

then after that it is messaged up until I stop and restart.

How do i prevent this from happening?

Thanks,

jerry


--


--
_
-- 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] dialplan reloading

2012-11-02 Thread Jerry Geis

Hi Jerry,
  From the Asterisk CLI, enter the command core restart when
convenient, this command will restart asterisk only when there is no
incoming call, and when it will close all outgoing calls.
With a restart of asterisk should reload all the information:
extensions, sip, agi, iax, voicemail, etc.

Danilo


Danilo,

Ok - but then what if a call comes in while it decides to reload - or
if an AGI is started while it decides to reload -   Sure there is nothing
happening at that moment - but lets say right after it decides that
its convenient and before its done - something gets started.

What to do about that?

Jerry
--
_
-- 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] dialplan reloading

2012-11-02 Thread Ishfaq Malik
On Fri, 2012-11-02 at 06:25 -0400, Jerry Geis wrote:
  Hi Jerry,
   From the Asterisk CLI, enter the command core restart when 
  convenient, this command will restart asterisk only when there is no 
  incoming call, and when it will close all outgoing calls.
  With a restart of asterisk should reload all the information: 
  extensions, sip, agi, iax, voicemail, etc.
  
  Danilo
  
 Danilo,
 
 Ok - but then what if a call comes in while it decides to reload -
 or 
 if an AGI is started while it decides to reload -   Sure there is
 nothing
 happening at that moment - but lets say right after it decides that 
 its convenient and before its done - something gets started.
 
 What to do about that?
 
 Jerry
 --
Sorry to step in here but I think the 2 of you are talking at cropp
purposes

I initial query was about a dialplan reload, not an asterisk restart.

Jerry, how long does your system take to perform a dialplan reload?
surely it is under a second. 

If you look in the logs, at the end of any dialplan reload (well in 1.8
at least) you will get some time stats such as below

[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Time to scan old dialplan 
and merge leftovers back into the new: 0.41 sec
[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Time to restore hints and 
swap in new dialplan: 0.03 sec
[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Time to delete the old 
dialplan: 0.04 sec
[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Total time 
merge_contexts_delete: 0.48 sec

As you can see in this example it takes under a ten thousandth of a
second.

Is that something to really be concerned about?

Regards

Ish


-- 
Ishfaq Malik i...@pack-net.co.uk
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: i...@pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552


--
_
-- 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] dialplan reloading

2012-11-02 Thread Jerry Geis

Sorry to step in here but I think the 2 of you are talking at cropp
purposes

I initial query was about a dialplan reload, not an asterisk restart.

Jerry, how long does your system take to perform a dialplan reload?
surely it is under a second.

If you look in the logs, at the end of any dialplan reload (well in 1.8
at least) you will get some time stats such as below

[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Time to scan old dialplan 
and merge leftovers back into the new: 0.41 sec
[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Time to restore hints and 
swap in new dialplan: 0.03 sec
[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Time to delete the old 
dialplan: 0.04 sec
[2012-10-29 00:10:03] VERBOSE[19096] pbx.c: -- Total time 
merge_contexts_delete: 0.48 sec

As you can see in this example it takes under a ten thousandth of a
second.

Is that something to really be concerned about?

Regards

Ish

Actually my mistake - looks like based on my code certain things happen
and I issue two dialplan reload commands. So the second is killing the 
first.

Then asterisk looses information.

So certainly I should not be doing that - but I'm surprised asterisk 
lets another reload

happen before the first is complete.

Jerry
--
_
-- 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] dialplan reloading

2012-11-02 Thread Joshua Colp

Jerry Geis wrote:

Actually my mistake - looks like based on my code certain things happen
and I issue two dialplan reload commands. So the second is killing the
first.
Then asterisk looses information.

So certainly I should not be doing that - but I'm surprised asterisk
lets another reload
happen before the first is complete.


What version of Asterisk are you running? There was an issue found in 
February where this exact behavior could occur, two dialplan reload 
commands would clobber each other. It was also resolved back then in all 
supported branches (1.8, 10, and trunk).


http://lists.digium.com/pipermail/asterisk-commits/2012-February/053537.html 
For the 1.8 fix if you are curious.


Cheers,

--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
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


Re: [asterisk-users] dialplan reloading

2012-11-02 Thread Jerry Geis


What version of Asterisk are you running? There was an issue found in
February where this exact behavior could occur, two dialplan reload
commands would clobber each other. It was also resolved back then in all
supported branches (1.8, 10, and trunk).

http://lists.digium.com/pipermail/asterisk-commits/2012-February/053537.html
For the 1.8 fix if you are curious.


Josh,

I am running 1.4.43, planning on switching to 11 but have not got there...

Thanks

Jerry

--
_
-- 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] dialplan reloading

2012-11-01 Thread Jerry Geis

If I issue a dialplan reload and some AGI starts as its reloading
and directs something into the diaplan that is still reloading

what happens

I presume my context is not there?

What I see is the diaplan is messed up somehow and I goto the default 
context

then after that it is messaged up until I stop and restart.

How do i prevent this from happening?

Thanks,

jerry


--
_
-- 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] dialplan problem : not including context

2012-01-26 Thread Jonas Kellens

On 01/13/2012 06:58 PM, Administrator TOOTAI wrote:

Le 13/01/2012 14:32, Jonas Kellens a écrit :

On 01/13/2012 02:23 PM, Doug Lytle wrote:


Jonas Kellens wrote:

I have the following in dialplan :


[TrunkAccounts]


dialplan show TrunkAccounts

Make sure the sort order is what you're expecting.

Doug


Hello,

The order is correct for as far as I'm sure.

[TrunkAccounts]

exten = 32380837,1,GoTo(01,32380837,1)
exten = 32380838,1,GoTo(01,32380838,1)
exten = 32380839,1,GoTo(01,32380839,1)

[CheckOnNet]

include = TrunkAccounts

exten = _321[0-3],1,GoTo(context1,${EXTEN},1)

exten = 3214,1,GoTo(context2, ${EXTEN} ,1)

exten = _.,1,NoOp()
exten = _.,n,Return()


Are you sure about your _. exten? Typo in the mail? It means 9 
and more digits but your extensions are 8 digits ...


Include are always treated *after* context command. If _. is 
right, something is wrong with Asterisk as it should treat 
TrunkAccounts. If _XXX. (8 digits or more) is what you have in 
yourdialplan, than the behavior of Asterisk is OK


Try

[TrunkAccounts]

exten = 32380837,1,GoTo(01,32380837,1)
exten = 32380838,1,GoTo(01,32380838,1)
exten = 32380839,1,GoTo(01,32380839,1)

[TrunkNotTreated]

exten = _.,1,NoOp()
exten = _.,n,Return()

[CheckOnNet]

include = TrunkAccounts
include = TrunkNotTreated

exten = _321[0-3],1,GoTo(context1,${EXTEN},1)
exten = 3214,1,GoTo(context2, ${EXTEN} ,1)

[...]



Hello,

I confirm that this is working for me !

Thanks !

Jonas.



--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Jonas Kellens

Hello,

I have the following in dialplan :


[TrunkAccounts]

exten = 32380837,1,GoTo(01,32380837,1)
exten = 32380838,1,GoTo(01,32380838,1)
exten = 32380839,1,GoTo(01,32380839,1)

[CheckOnNet]

include = TrunkAccounts



But when a call for 32380837 enters CheckOnNet, it is not found. How come ??



Kind regards,
Jonas.
--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Doug Lytle


Jonas Kellens wrote:

I have the following in dialplan :


[TrunkAccounts]


dialplan show TrunkAccounts

Make sure the sort order is what you're expecting.

Doug


--

Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary Safety, 
deserve neither Liberty nor Safety.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Jonas Kellens

On 01/13/2012 02:23 PM, Doug Lytle wrote:


Jonas Kellens wrote:

I have the following in dialplan :


[TrunkAccounts]


dialplan show TrunkAccounts

Make sure the sort order is what you're expecting.

Doug


Hello,

The order is correct for as far as I'm sure.

[TrunkAccounts]

exten = 32380837,1,GoTo(01,32380837,1)
exten = 32380838,1,GoTo(01,32380838,1)
exten = 32380839,1,GoTo(01,32380839,1)

[CheckOnNet]

include = TrunkAccounts

exten = _321[0-3],1,GoTo(context1,${EXTEN},1)

exten = 3214,1,GoTo(context2,${EXTEN},1)

exten = _.,1,NoOp()
exten = _.,n,Return()


This is what I see on the CLI :

/[Jan 13 14:30:01] -- Executing [s@macro-uit789:47] 
Gosub(SIP/yoc1-5a3c, CheckOnNet,//32380837,1) in new stack
[Jan 13 14:30:01] -- Executing [32380837@CheckOnNet:1] 
NoOp(SIP/yoc1-5a3c, ) in new stack
[Jan 13 14:30:01] -- Executing [32380837//@CheckOnNet:2] 
Return(SIP/yoc1-5a3c, ) in new stack/



So the context TrunkAccounts is not included.

Do you know why ?


Jonas.
--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Andreas Sikkema
On 1/13/12 2:32 PM, Jonas Kellens wrote:
 So the context TrunkAccounts is not included.
 
 Do you know why ?

Does reloading the dialplan (dialplan reload) give any useful output
relating to these two contexts?

-- 
Andreas Sikkema

--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Jonas Kellens

On 01/13/2012 02:37 PM, Andreas Sikkema wrote:

On 1/13/12 2:32 PM, Jonas Kellens wrote:

So the context TrunkAccounts is not included.

Do you know why ?

Does reloading the dialplan (dialplan reload) give any useful output
relating to these two contexts?


I include this context in 2 other contexts :

[Jan 13 14:19:12] VERBOSE[4220] config.c: [Jan 13 14:19:12]   == Parsing 
'/etc/asterisk/extensions.conf': [Jan 13 14:19:12] VERBOSE[4220] 
config.c: [Jan 13 14:19:12]   == Found

...
[Jan 13 14:19:12] VERBOSE[4220] pbx.c: [Jan 13 14:19:12] -- 
Including context 'TrunkAccounts' in context 'PROVIDERin'

...
[Jan 13 14:19:12] VERBOSE[4220] pbx.c: [Jan 13 14:19:12] -- 
Registered extension context 'CheckOnNet' (0x2aaacc40d260) in local 
table 0xd0ba610; registrar: pbx_config
[Jan 13 14:19:12] VERBOSE[4220] pbx.c: [Jan 13 14:19:12] -- 
Including context 'TrunkAccounts' in context 'CheckOnNet'

...

Nothing special here it seems...


Everything works fine when including context 'TrunkAccounts' in context 
'PROVIDERin'. Here it functions as expected.


But it does not work the same in context 'CheckOnNet'.

Extra question : is there a difference between the context PROVIDERin 
and the procedure (sub) CheckOnNet ??



Kind regards,

Jonas.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Doug Lytle


Jonas Kellens wrote:
Everything works fine when including context 'TrunkAccounts' in 
context 'PROVIDERin


dialplan showPROVIDERin

Doug

--

Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary Safety, 
deserve neither Liberty nor Safety.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Jonas Kellens

On 01/13/2012 02:59 PM, Doug Lytle wrote:


Jonas Kellens wrote:
Everything works fine when including context 'TrunkAccounts' in 
context 'PROVIDERin


dialplan showPROVIDERin

Doug



Meaning ?

--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Doug Lytle


Jonas Kellens wrote:
Meaning ? 


Meaning I want to see the dialplan order of that context.  I'm guessing 
that's your inbound context.  With includes that also include sub-contexts.


Usually, there is something ordered differently then expected.

Also, what version of Asterisk?

Doug


--

Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary Safety, 
deserve neither Liberty nor Safety.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Jonas Kellens

On 01/13/2012 03:07 PM, Doug Lytle wrote:


Jonas Kellens wrote:
Meaning ? 


Meaning I want to see the dialplan order of that context.  I'm 
guessing that's your inbound context.  With includes that also include 
sub-contexts.


Usually, there is something ordered differently then expected.

Also, what version of Asterisk?

Doug


Asterisk 1.6.2.22

It is impossible to post all of this information... However, this is the 
context CheckOnNet :


...snip...
  '_32962' =  1. GoTo(solutions,${EXTEN},1) [pbx_config]
  '_3295[0-9]' = 1. GoTo(step,${EXTEN},1)   [pbx_config]
  '_.' =   1. NoOp() 
[pbx_config]
2. Return()   
[pbx_config]
  Include ='TrunkAccounts'   
[pbx_config]


-= 252 extensions (253 priorities) in 1 context. =-


Does this mean the Return() comes before Asterisk looks into the context 
[TrunkAccounts] ??



Kind regards,
Jonas.

--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Doug Lytle


Jonas Kellens wrote:
Does this mean the Return() comes before Asterisk looks into the 
context [TrunkAccounts] ??


No, I believe the includes are read first, but the order in important.

Since you may be matching against another context that may cause 
failure.  For example, I have the following in a internal context:


  Include ='analog-extensions'   
[pbx_config]
  Include ='sip-utilities'   
[pbx_config]
  Include ='internal-extensions' 
[pbx_config]
  Include ='dial-local'  
[pbx_config]
  Include ='dial-ld' 
[pbx_config]
  Include ='incoming'
[pbx_config]
  Include ='fall-through'
[pbx_config]


If I had fall-through first, it'd cause lots of issues.

Doug


--

Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary Safety, 
deserve neither Liberty nor Safety.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Jonas Kellens

On 01/13/2012 04:22 PM, Doug Lytle wrote:


Jonas Kellens wrote:
Does this mean the Return() comes before Asterisk looks into the 
context [TrunkAccounts] ??


No, I believe the includes are read first, but the order in important.

Since you may be matching against another context that may cause 
failure.  For example, I have the following in a internal context:


  Include ='analog-extensions'   
[pbx_config]
  Include ='sip-utilities'   
[pbx_config]
  Include ='internal-extensions' 
[pbx_config]
  Include ='dial-local'  
[pbx_config]
  Include ='dial-ld' 
[pbx_config]
  Include ='incoming'
[pbx_config]
  Include ='fall-through'
[pbx_config]


If I had fall-through first, it'd cause lots of issues.

Doug


Hello,

there is only one include-statement...


Jonas.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Doug Lytle


Jonas Kellens wrote:

there is only one include-statement


Then I don't know.  I am still on 1.4.x and my PRI context contains all 
that I'm matching against (No sub contexts).


Doug


--

Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary Safety, 
deserve neither Liberty nor Safety.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Doug Lytle


Doug Lytle wrote:



Then I don't know.  I am still on 1.4.x and my PRI context contains 
all that I'm matching against (No sub contexts).




One thing does come to mind;  the inbound call is coming into your s 
extension and then your doing a gosub, in which case, you might be 
matching against s.


Put in a few NoOP statements to find out what EXTEN or ARG1 is.

Doug


--

Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary Safety, 
deserve neither Liberty nor Safety.


--
_
-- 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] dialplan problem : not including context

2012-01-13 Thread Administrator TOOTAI

Le 13/01/2012 14:32, Jonas Kellens a écrit :

On 01/13/2012 02:23 PM, Doug Lytle wrote:


Jonas Kellens wrote:

I have the following in dialplan :


[TrunkAccounts]


dialplan show TrunkAccounts

Make sure the sort order is what you're expecting.

Doug


Hello,

The order is correct for as far as I'm sure.

[TrunkAccounts]

exten = 32380837,1,GoTo(01,32380837,1)
exten = 32380838,1,GoTo(01,32380838,1)
exten = 32380839,1,GoTo(01,32380839,1)

[CheckOnNet]

include = TrunkAccounts

exten = _321[0-3],1,GoTo(context1,${EXTEN},1)

exten = 3214,1,GoTo(context2, ${EXTEN} ,1)

exten = _.,1,NoOp()
exten = _.,n,Return()


Are you sure about your _. exten? Typo in the mail? It means 9 
and more digits but your extensions are 8 digits ...


Include are always treated *after* context command. If _. is 
right, something is wrong with Asterisk as it should treat 
TrunkAccounts. If _XXX. (8 digits or more) is what you have in 
yourdialplan, than the behavior of Asterisk is OK


Try

[TrunkAccounts]

exten = 32380837,1,GoTo(01,32380837,1)
exten = 32380838,1,GoTo(01,32380838,1)
exten = 32380839,1,GoTo(01,32380839,1)

[TrunkNotTreated]

exten = _.,1,NoOp()
exten = _.,n,Return()

[CheckOnNet]

include = TrunkAccounts
include = TrunkNotTreated

exten = _321[0-3],1,GoTo(context1,${EXTEN},1)
exten = 3214,1,GoTo(context2, ${EXTEN} ,1)

[...]

--
Daniel

--
_
-- 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] dialplan - dial command - custom ringtone

2012-01-03 Thread Qqblog Qqblog
i could add r option in dial command. this will generate a ringtone during 
connection. could i change this default ringtone?

i tried indications.conf but not success.
--
_
-- 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] dialplan - dial command - custom ringtone

2012-01-03 Thread Carlos Rojas
Hello

Do you use hard phone or softphone?

In many ip phones you can change the ring tones or use w option in Dial
command

Regards
On Jan 3, 2012 4:08 AM, Qqblog Qqblog qqb...@ymail.com wrote:

 i could add r option in dial command. this will generate a ringtone
 during connection. could i change this default ringtone?

 i tried indications.conf but not success.

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

[asterisk-users] Dialplan required for recording

2011-07-28 Thread Vinod Dharashive
Hi team,

Can any one help me to implement dialplan in which conversation between a-party 
and b-party (call patch) needs to be recorded.

Thanks
Vinod Dharashive
Sent from BlackBerry® on Airtel
--
_
-- 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] Dialplan required for recording

2011-07-28 Thread DHAVAL INDRODIYA
Hi Vinod,

You Need to look in MIxmonitor application on asterisk.

http://www.voip-info.org/wiki/view/MixMonitor

http://www.the-asterisk-book.com/unstable/applikationen-mixmonitor.html

Where you can find easy dialplan

On Fri, Jul 29, 2011 at 4:35 AM, Vinod Dharashive vdharash...@gmail.comwrote:

 Hi team,

 Can any one help me to implement dialplan in which conversation between
 a-party and b-party (call patch) needs to be recorded.

 Thanks
 Vinod Dharashive
 Sent from BlackBerry® on Airtel
 --
 _
 -- 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] dialplan pattern help

2011-07-24 Thread Armand Fumal
Thanks for the suggestion.
If I have to do this way i will check the AGI side...
Thanks

Armand

-Message d'origine-
De : asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] De la part de Leif Madsen
Envoyé : samedi 23 juillet 2011 20:18
À : asterisk-users@lists.digium.com
Objet : Re: [asterisk-users] dialplan pattern help

On 11-07-23 10:30 AM, Armand Fumal wrote:
 Hi all,
 
 I need help for make a pattern for a special case that i can't find the 
 solution.
 
 In my case I want to match these in one pattern:
 
 This is the same ext that can come in 4 cases
 
 exten = _42704701,1,Macro(dialfax,${EXTEN:-8})   ; case with 
 42704701
 exten = _X42704701,1,Macro(dialfax,${EXTEN:-8})  ; case with 
 042704701
 exten = _42704701,1,Macro(dialfax,${EXTEN:-8})   ; case with +3242704701
 exten = _XXX42704701,1,Macro(dialfax,${EXTEN:-8}); case with 
 3242704701
 
 I have try _.42704701 but the parser stop to check after the point .:-(
 
 So did you have any suggestion ?

Ya you can't match anything after the '.' in pattern matching.

I'm not sure the pattern matcher is really capable of doing what you want here.
The only way to do it really is to match less restrictively and perform a check 
using dialplan applications/functions, and then if nothing is found, to fall 
through.

Perhaps something like:


exten = _XXX,1,NoOp()
   same = n,ExecIf($[${EXTEN:-8} = 42704701]?Macro(dialfax,${EXTEN:-8}))
   same = n,Verbose(2,Did not match -- falling through)
   same = n,Playback(invalid)
   same = n,Hangup()

I'm pretty sure that's the only way you can do it in a single line (the 
ExecIf() application).

Leif Madsen.

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


[asterisk-users] dialplan pattern help

2011-07-23 Thread Armand Fumal
Hi all,

I need help for make a pattern for a special case that i can't find the 
solution.

In my case I want to match these in one pattern:

This is the same ext that can come in 4 cases

exten = _42704701,1,Macro(dialfax,${EXTEN:-8}) ; case with 42704701
exten = _X42704701,1,Macro(dialfax,${EXTEN:-8}); case with 
042704701
exten = _42704701,1,Macro(dialfax,${EXTEN:-8}) ; case with +3242704701
exten = _XXX42704701,1,Macro(dialfax,${EXTEN:-8})  ; case with 
3242704701

I have try _.42704701 but the parser stop to check after the point .:-(

So did you have any suggestion ?

Regards

Armand Fumal


--
_
-- 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] dialplan pattern help

2011-07-23 Thread Leif Madsen
On 11-07-23 10:30 AM, Armand Fumal wrote:
 Hi all,
 
 I need help for make a pattern for a special case that i can't find the 
 solution.
 
 In my case I want to match these in one pattern:
 
 This is the same ext that can come in 4 cases
 
 exten = _42704701,1,Macro(dialfax,${EXTEN:-8})   ; case with 
 42704701
 exten = _X42704701,1,Macro(dialfax,${EXTEN:-8})  ; case with 
 042704701
 exten = _42704701,1,Macro(dialfax,${EXTEN:-8})   ; case with +3242704701
 exten = _XXX42704701,1,Macro(dialfax,${EXTEN:-8}); case with 
 3242704701
 
 I have try _.42704701 but the parser stop to check after the point .:-(
 
 So did you have any suggestion ?

Ya you can't match anything after the '.' in pattern matching.

I'm not sure the pattern matcher is really capable of doing what you want here.
The only way to do it really is to match less restrictively and perform a check
using dialplan applications/functions, and then if nothing is found, to fall
through.

Perhaps something like:


exten = _XXX,1,NoOp()
   same = n,ExecIf($[${EXTEN:-8} = 42704701]?Macro(dialfax,${EXTEN:-8}))
   same = n,Verbose(2,Did not match -- falling through)
   same = n,Playback(invalid)
   same = n,Hangup()

I'm pretty sure that's the only way you can do it in a single line (the ExecIf()
application).

Leif Madsen.

--
_
-- 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] dialplan: all extern, except

2011-07-15 Thread Hans Witvliet
Hi all,

Perhaps a no-brainer, but i think i am making my dialplan on my proxy
too complicated. 

Normally, what you find in the examples is that you have to dial a
specific number, other 9 or 0 for an external line.

What i want to do is this:
If you pre-pend a number with something like * then you can dial local
defined numbers, otherwise everything goes through my iax-trunk-line.

So for instance:
*#1 gives you a local welcome text
*#2 gives you the local echo function

while
#1 gives you a remote welcome text
#2 gives you the remote echo function

And ordinary numbers or sip's go straight extern:
0174539053 or j.witvl...@a-domani.nl should go to my main
asterisk-server.


Currently i'm doing it pattern-matching all numbers, and each upper
+lower case character, but i wonder if it can be done simpler.

Hans

--
_
-- 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] dialplan execution stops after ReceiveFax

2011-06-29 Thread Ruben Rögels
Hello,

I have a noticed strange behavior in Asterisk 1.6.18.2 with ReceiveFax
Digium FAX Driver: 1.6.2.0_1.3.0 (optimized for i686_32).

I use a context [capi-in] for icoming ISDN calls:


==
[capi-in]
; Faxe fuer Ruben
exten = 12345,1,Macro(faxin,ruben.roeg...@jumping-frog.org,${EXTEN})
==

My macro for the fax receiving looks like that:

==
[macro-faxin]
; Faxe
; ARG1 = eMail-Adresse
exten = s,1,Verbose(${BOUNDARY} Eingehender Ruf von ${CALLERID(num)})
exten = s,n,Verbose(${BOUNDARY} BCHANNELINFO ${BCHANNELINFO})
; nur verarbeiten, wenn B-Kanal frei ist
exten = s,n,GotoIf($[${BCHANNELINFO} = 2]?hangup:free)
exten = s,n(free),NoOp()
exten = s,n,Set(TO=${ARG1})
exten = s,n,Verbose(1,${BOUNDARY} Eingehendes Fax ${CDR(uniqueid)})
exten = s,n,Set(FAXFILE=/var/spool/fax/fax-${TO}-${CDR(uniqueid)}.tif)
exten = s,n,Set(LOCALSTATIONID=jumping frog)
exten = s,n,Answer()
exten = s,n,Wait(3)
exten = s,n,ReceiveFAX(${FAXFILE},d)
exten = s,n,Verbose(1,${BOUNDARY} Nach dem Fax!)
exten = s,n,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})
;exten = s,n,capicommand(receivefax,${FAXFILE},+00497613821,Headline,k)
exten = s,n(hangup),HangUp()
exten = h,1,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})
==

As you can see, the received fax file should be processed by a
bash-script, but after the call hangs up, the script is never executed.

The console log shows:

==
 -- Channel 'CAPI/ISDN1#02/3821-5' FAX session '4' is complete,
result: 'SUCCESS' (FAX_SUCCESS), error: 'NO_ERROR', pages: 1,
resolution: '204x98', transfer rate: '9600', remoteSID: '4932123847885'
  == Spawn extension (macro-faxin, s, 11) exited non-zero on
'CAPI/ISDN1#02/12345-5' in macro 'faxin'
  == Spawn extension (capi-in, 12345, 1) exited non-zero on
'CAPI/ISDN1#02/12345-5'
  == ISDN1#02: CAPI Hangingup for PLCI=0x101 in state 2
ISDN1#02: CAPI INFO 0x3490: Normal call clearing
==

Anyone seeing what I'm missing?

Thank you.


Regards,
Ruben

--
_
-- 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] dialplan execution stops after ReceiveFax

2011-06-29 Thread Larry Moore

On 29/06/2011 5:13 PM, Ruben Rögels wrote:

Hello,

I have a noticed strange behavior in Asterisk 1.6.18.2 with ReceiveFax
Digium FAX Driver: 1.6.2.0_1.3.0 (optimized for i686_32).

I use a context [capi-in] for icoming ISDN calls:


==
[capi-in]
; Faxe fuer Ruben
exten =  12345,1,Macro(faxin,ruben.roeg...@jumping-frog.org,${EXTEN})
==

My macro for the fax receiving looks like that:

==
[macro-faxin]
; Faxe
; ARG1 = eMail-Adresse
exten =  s,1,Verbose(${BOUNDARY} Eingehender Ruf von ${CALLERID(num)})
exten =  s,n,Verbose(${BOUNDARY} BCHANNELINFO ${BCHANNELINFO})
; nur verarbeiten, wenn B-Kanal frei ist
exten =  s,n,GotoIf($[${BCHANNELINFO} = 2]?hangup:free)
exten =  s,n(free),NoOp()
exten =  s,n,Set(TO=${ARG1})
exten =  s,n,Verbose(1,${BOUNDARY} Eingehendes Fax ${CDR(uniqueid)})
exten =  s,n,Set(FAXFILE=/var/spool/fax/fax-${TO}-${CDR(uniqueid)}.tif)
exten =  s,n,Set(LOCALSTATIONID=jumping frog)
exten =  s,n,Answer()
exten =  s,n,Wait(3)
exten =  s,n,ReceiveFAX(${FAXFILE},d)
exten =  s,n,Verbose(1,${BOUNDARY} Nach dem Fax!)
exten =  s,n,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})
;exten =  s,n,capicommand(receivefax,${FAXFILE},+00497613821,Headline,k)
exten =  s,n(hangup),HangUp()
exten =  h,1,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})
==

As you can see, the received fax file should be processed by a
bash-script, but after the call hangs up, the script is never executed.

The console log shows:

==
  -- Channel 'CAPI/ISDN1#02/3821-5' FAX session '4' is complete,
result: 'SUCCESS' (FAX_SUCCESS), error: 'NO_ERROR', pages: 1,
resolution: '204x98', transfer rate: '9600', remoteSID: '4932123847885'
   == Spawn extension (macro-faxin, s, 11) exited non-zero on
'CAPI/ISDN1#02/12345-5' in macro 'faxin'
   == Spawn extension (capi-in, 12345, 1) exited non-zero on
'CAPI/ISDN1#02/12345-5'
   == ISDN1#02: CAPI Hangingup for PLCI=0x101 in state 2
  ISDN1#02: CAPI INFO 0x3490: Normal call clearing
==

Anyone seeing what I'm missing?


Hi Ruben,

You should be looking at this thread 
http://lists.digium.com/pipermail/asterisk-users/2011-June/263995.html


Presently I don't have the time to generate and send logs however soon 
after my last post I did perform additional testing.


I am using ReceiveFAX using SPANDSP technology.

The occasions the System() call would not be executed, whether it was in 
'h' of the dialplan  or the main part of the macro after ReceiveFAX(), 
was when a T.38 fax was being received, when it was a G.711 fax no 
matter what I did to the call it would always execute the System() call 
whether it was in the macro or the 'h'.


Cheers,

Larry.


--
_
-- 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] dialplan execution stops after ReceiveFax

2011-06-29 Thread Ruben Rögels

 Hi Ruben,
 
 You should be looking at this thread
 http://lists.digium.com/pipermail/asterisk-users/2011-June/263995.html
 
 Presently I don't have the time to generate and send logs however soon
 after my last post I did perform additional testing.
 
 I am using ReceiveFAX using SPANDSP technology.
 
 The occasions the System() call would not be executed, whether it was in
 'h' of the dialplan  or the main part of the macro after ReceiveFAX(),
 was when a T.38 fax was being received, when it was a G.711 fax no
 matter what I did to the call it would always execute the System() call
 whether it was in the macro or the 'h'.
 
 Cheers,
 
 Larry.

Hi Larry,

Ok. It looks like I don't understand the asterisks context and macro
system deep enough.

I tried to set

==
; Faxe fuer Ruben
exten = 3821,1,Macro(faxin,ruben.roeg...@jumping-frog.org,${EXTEN})
exten = h,1,System(/usr/local/bin/fax2mail.sh ${FAXFILE} ${TO})
==

Of couse I have to set up some number filtering but now, my bash script
is beeing executed.

So, as I understand the thread you gave me to read, the h-extension is
called in the context from which the macro is called and not in the
macro itself? This could explain why it works now.

Anyway, thank you for giving me the opportunity to look beyond my own
backyard!

Regards,
Ruben

--
_
-- 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] dialplan is not finding my number asterisk 1.8.3

2011-04-05 Thread Jerry Geis

Jerry Geis wrote:
I am calling from a polycom phone into asterisk ( 1105 ) on a PC with 
a speaker attached.


When asterisk first starts this works. In fact it works for some time. 
Then it just stops with this error on the CLI.


[Apr  4 15:10:21] NOTICE[4357]: chan_sip.c:21358 
handle_request_invite: Call from 'mndemo_to_mediaport105' to extension 
'1105' rejected because extension not found in context 
'smvoice-mediaport'.


When doing the dialplan show it clearly in the context.

[ Context 'smvoice-mediaport' created by 'pbx_config' ]
 '1105' = 1. Goto(smvoice-mediaport-public-address,s,1) 
[pbx_config]



Its telling me it cannot find it. Its there - the dialplan shows its 
there.

When I stop and start it works again for a little while.
Matter of fact I just issued dialplan reload and calling into 1105 
works again.


Whats up? How do I get this to be consistent?

Jerry


I just looked in my extensions.conf and I do not have 
extenpatternmatchnew at all. My understanding is that

it is off by default.

my sip.conf has:
register = mndemo_to_mediaport105:secret@mndemo

; Description:
[mndemo_to_mediaport105]
type=friend
defaultname=mndemo_to_mediaport105
username=mndemo_to_mediaport105
secret=secret
disallow=all
allow=ulaw
allow=alaw
allow=gsm
rtptimeout=60
host=192.168.1.58
context=smvoice-mediaport


I was not aware I needed another context of :

[mndemo_to_mediaport105]
include = smvoice-mediaport


The context is set above in sip.conf and that is what the CLI above is showing 
its using.


Also my extensions.conf section is :

--
[smvoice-mediaport-public-address]
exten = s,1,System(/home/silentm/bin/smfunctions -stop)
exten = s,n,Playback(beep)
exten = s,n,Dial(Console/dsp)
exten = s,n,Hangup
exten = h,1,System(/home/silentm/bin/smfunctions -start)

[smvoice-mediaport]
exten = public_address,1,Goto(smvoice-mediaport-public-address,s,1)

#include /etc/asterisk/express.dnis.conf

--
where express.dnis.conf has:
; Phone Caller ID  DNIS Manager screen

; MMPCGA: VISUAL PC ROOM 105 - 
exten = 1105,1,Goto(smvoice-mediaport-public-address,s,1)


---
Here is a call that works:
 == Using SIP RTP CoS mark 5
   -- Executing [1105@smvoice-mediaport:1] Goto(SIP/mndemo_to_mediaport105-0003, 
smvoice-mediaport-public-address,s,1) in new stack
   -- Goto (smvoice-mediaport-public-address,s,1)
   -- Executing [s@smvoice-mediaport-public-address:1] 
System(SIP/mndemo_to_mediaport105-0003, /home/silentm/bin/smfunctions 
-stop) in new stack
   -- Executing [s@smvoice-mediaport-public-address:2] 
Playback(SIP/mndemo_to_mediaport105-0003, beep) in new stack
   -- SIP/mndemo_to_mediaport105-0003 Playing 'beep.gsm' (language 'en')
   -- Executing [s@smvoice-mediaport-public-address:3] 
Dial(SIP/mndemo_to_mediaport105-0003, Console/dsp) in new stack
 Call placed to 'dsp' on console  
 Auto-answered  
   -- Called dsp

   -- ALSA/dummy answered SIP/mndemo_to_mediaport105-0003
   -- Executing [h@smvoice-mediaport-public-address:1] 
System(SIP/mndemo_to_mediaport105-0003, /home/silentm/bin/smfunctions 
-start) in new stack
 Hangup on console  
 == Spawn extension (smvoice-mediaport-public-address, s, 3) exited non-zero on 'SIP/mndemo_to_mediaport105-0003'

--


As I mentioned starting asterisk all this works. There is some random 
time later - perhaps days where it then stops

finding the exten.

Is there something I have wrong in the config above?

Jerry

--
_
-- 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] dialplan is not finding my number asterisk 1.8.3

2011-04-05 Thread Steve Murphy
Idea:

If something is corrupting your dialplan, then this should
reveal the extent of the corruption:

You might, when the system is working properly, do a:

asterisk -rx dialplan show  somefile1

and then, when you are having problems, do a:

asterisk -rx dialplan show  somefile2
diff -u somefile1 somefile2

and see if this reveals anything juicy.

murf



On Tue, Apr 5, 2011 at 5:44 AM, Jerry Geis ge...@pagestation.com wrote:

 Jerry Geis wrote:

 I am calling from a polycom phone into asterisk ( 1105 ) on a PC with a
 speaker attached.

 When asterisk first starts this works. In fact it works for some time.
 Then it just stops with this error on the CLI.

 [Apr  4 15:10:21] NOTICE[4357]: chan_sip.c:21358 handle_request_invite:
 Call from 'mndemo_to_mediaport105' to extension '1105' rejected because
 extension not found in context 'smvoice-mediaport'.

 When doing the dialplan show it clearly in the context.

 [ Context 'smvoice-mediaport' created by 'pbx_config' ]
  '1105' = 1. Goto(smvoice-mediaport-public-address,s,1)
 [pbx_config]


 Its telling me it cannot find it. Its there - the dialplan shows its
 there.
 When I stop and start it works again for a little while.
 Matter of fact I just issued dialplan reload and calling into 1105 works
 again.

 Whats up? How do I get this to be consistent?

 Jerry


  I just looked in my extensions.conf and I do not have
 extenpatternmatchnew at all. My understanding is that
 it is off by default.

 my sip.conf has:
 register = mndemo_to_mediaport105:secret@mndemo

 ; Description:
 [mndemo_to_mediaport105]
 type=friend
 defaultname=mndemo_to_mediaport105
 username=mndemo_to_mediaport105
 secret=secret
 disallow=all
 allow=ulaw
 allow=alaw
 allow=gsm
 rtptimeout=60
 host=192.168.1.58
 context=smvoice-mediaport


 I was not aware I needed another context of :

 [mndemo_to_mediaport105]
 include = smvoice-mediaport


 The context is set above in sip.conf and that is what the CLI above is
 showing its using.


 Also my extensions.conf section is :

 --
 [smvoice-mediaport-public-address]
 exten = s,1,System(/home/silentm/bin/smfunctions -stop)
 exten = s,n,Playback(beep)
 exten = s,n,Dial(Console/dsp)
 exten = s,n,Hangup
 exten = h,1,System(/home/silentm/bin/smfunctions -start)

 [smvoice-mediaport]
 exten = public_address,1,Goto(smvoice-mediaport-public-address,s,1)

 #include /etc/asterisk/express.dnis.conf

 --
 where express.dnis.conf has:
 ; Phone Caller ID  DNIS Manager screen

 ; MMPCGA: VISUAL PC ROOM 105 - exten =
 1105,1,Goto(smvoice-mediaport-public-address,s,1)

 ---
 Here is a call that works:
  == Using SIP RTP CoS mark 5
   -- Executing [1105@smvoice-mediaport:1]
 Goto(SIP/mndemo_to_mediaport105-0003,
 smvoice-mediaport-public-address,s,1) in new stack
   -- Goto (smvoice-mediaport-public-address,s,1)
   -- Executing [s@smvoice-mediaport-public-address:1]
 System(SIP/mndemo_to_mediaport105-0003, /home/silentm/bin/smfunctions
 -stop) in new stack
   -- Executing [s@smvoice-mediaport-public-address:2]
 Playback(SIP/mndemo_to_mediaport105-0003, beep) in new stack
   -- SIP/mndemo_to_mediaport105-0003 Playing 'beep.gsm' (language
 'en')
   -- Executing [s@smvoice-mediaport-public-address:3]
 Dial(SIP/mndemo_to_mediaport105-0003, Console/dsp) in new stack
  Call placed to 'dsp' on console   Auto-answered -- Called dsp
   -- ALSA/dummy answered SIP/mndemo_to_mediaport105-0003
   -- Executing [h@smvoice-mediaport-public-address:1]
 System(SIP/mndemo_to_mediaport105-0003, /home/silentm/bin/smfunctions
 -start) in new stack
  Hangup on console   == Spawn extension
 (smvoice-mediaport-public-address, s, 3) exited non-zero on
 'SIP/mndemo_to_mediaport105-0003'
 --


 As I mentioned starting asterisk all this works. There is some random time
 later - perhaps days where it then stops
 finding the exten.

 Is there something I have wrong in the config above?

 Jerry

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




-- 

Steve Murphy

ParseTree Corporation

57 Lane 17

Cody, WY 82414

✉  m...@parsetree.com

☎ 307-899-5535
--
_
-- 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] dialplan is not finding my number asterisk 1.8.3

2011-04-05 Thread Jerry Geis


Steve Murphy wrote:

Idea:

If something is corrupting your dialplan, then this should
reveal the extent of the corruption:

You might, when the system is working properly, do a:

asterisk -rx dialplan show  somefile1

and then, when you are having problems, do a:

asterisk -rx dialplan show  somefile2
diff -u somefile1 somefile2

and see if this reveals anything juicy.

murf



Steve,

That is a great idea. I did that the first time it happened. I dumped 
the dialplan, then I restarted
and dumped again. it was the same. Being the first time I thought it was 
just a fluke but now it
has happened a couple of times. I have not been able to narrow anything 
down.


Thanks,

jerry

--
_
-- 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] dialplan is not finding my number asterisk 1.8.3

2011-04-05 Thread Jerry Geis

Jerry Geis wrote:


Steve Murphy wrote:

Idea:

If something is corrupting your dialplan, then this should
reveal the extent of the corruption:

You might, when the system is working properly, do a:

asterisk -rx dialplan show  somefile1

and then, when you are having problems, do a:

asterisk -rx dialplan show  somefile2
diff -u somefile1 somefile2

and see if this reveals anything juicy.

murf



Steve,

That is a great idea. I did that the first time it happened. I dumped 
the dialplan, then I restarted
and dumped again. it was the same. Being the first time I thought it 
was just a fluke but now it
has happened a couple of times. I have not been able to narrow 
anything down.


Thanks,

jerry


Steve,

perhaps I did something wrong the first time. As I just got the error 
again. I dumped the dialplan and my section:


[ Context 'smvoice-mediaport' created by 'pbx_config' ]

is empty.

when I restart and dump again.

[ Context 'smvoice-mediaport' created by 'pbx_config' ]
 '1105' = 1. Goto(smvoice-mediaport-public-address,s,1) 
[pbx_config]
 'mediaport_direct' = 1. Goto(smvoice-mediaport-public-address,s,1) 
[pbx_config]
 'public_address' = 1. Goto(smvoice-mediaport-public-address,s,1) 
[pbx_config]


I have the correct data.

The only thing I have in the dialplan for this box is:
[smvoice-mediaport-public-address]
exten = s,1,System(/home/silentm/bin/smfunctions -stop)
exten = s,n,Playback(beep)
exten = s,n,Dial(Console/dsp)
exten = s,n,Hangup
exten = h,1,System(/home/silentm/bin/smfunctions -start)

Can a system call be removing stuff from the dialplan?

What next?

Jerry


--
_
-- 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] dialplan is not finding my number asterisk 1.8.3

2011-04-05 Thread Steve Murphy
Oh, you are *not* going to like this, but

you have a few different paths:

1. If the dialplan stuff is not really a memory corruption, but some sort of
unplanned,
but maybe accidentally programmed thing, either by you or something in
the asterisk
code, then:

a. compile asterisk for debug. You can get in the menuselect stuff and make
sure
the debug compile options are turned on. Install it.
b. Shut down asterisk
c. fire it back up, under gdb:

  gdb full path to asterisk
  br ast_context_remove_extension_callerid2
  comm 1
 where
 c
 end
  run normal arguments to asterisk

Then use asterisk as normal and wait for the problem to re-occur. Look to
see if any
calls to ast_context_remove_extension_callerid2 occurred (they will occur
with dial reloads-- lots of them).
You'll have to search carefully! The gdb messages could be buried in your
console output.

If the problem reoccurs, but you didn't see any calls to
ast_context_remove_extension_callerid2,
then it could be assumed that you are suffering some sort of memory
corruption.
Where it dies, or things start looking strange, may not indicate where or
why the corruption is
happening. In such a case, it really gets tricky to debug. Then we might
resort to
stuff like dmalloc, and others, to help spot where/when corruption occurs.
Let's cross that
bridge if we come to it.

murf


On Tue, Apr 5, 2011 at 7:30 AM, Jerry Geis ge...@pagestation.com wrote:

 Jerry Geis wrote:


 Steve Murphy wrote:

 Idea:

 If something is corrupting your dialplan, then this should
 reveal the extent of the corruption:

 You might, when the system is working properly, do a:

 asterisk -rx dialplan show  somefile1

 and then, when you are having problems, do a:

 asterisk -rx dialplan show  somefile2
 diff -u somefile1 somefile2

 and see if this reveals anything juicy.

 murf


 Steve,

 That is a great idea. I did that the first time it happened. I dumped the
 dialplan, then I restarted
 and dumped again. it was the same. Being the first time I thought it was
 just a fluke but now it
 has happened a couple of times. I have not been able to narrow anything
 down.

 Thanks,

 jerry

  Steve,

 perhaps I did something wrong the first time. As I just got the error
 again. I dumped the dialplan and my section:


 [ Context 'smvoice-mediaport' created by 'pbx_config' ]

 is empty.

 when I restart and dump again.


 [ Context 'smvoice-mediaport' created by 'pbx_config' ]
  '1105' = 1. Goto(smvoice-mediaport-public-address,s,1)
 [pbx_config]
  'mediaport_direct' = 1. Goto(smvoice-mediaport-public-address,s,1)
 [pbx_config]
  'public_address' = 1. Goto(smvoice-mediaport-public-address,s,1)
 [pbx_config]

 I have the correct data.

 The only thing I have in the dialplan for this box is:

 [smvoice-mediaport-public-address]
 exten = s,1,System(/home/silentm/bin/smfunctions -stop)
 exten = s,n,Playback(beep)
 exten = s,n,Dial(Console/dsp)
 exten = s,n,Hangup
 exten = h,1,System(/home/silentm/bin/smfunctions -start)

 Can a system call be removing stuff from the dialplan?

 What next?

Oh, you are *not* going to like this, but

you have a few different paths:

1. If the dialplan stuff is not really a memory corruption, but some sort of
unplanned,
but maybe accidentally programmed thing, either by you or something in
the asterisk
code, then:

a. compile asterisk for debug. You can get in the menuselect stuff and make
sure
the debug compile options are turned on. Install it.
b. Shut down asterisk
c. fire it back up, under gdb:

  gdb full path to asterisk
  br ast_context_remove_extension_callerid2
  comm 1
 where
 c
 end
  run normal arguments to asterisk

Then use asterisk as normal and wait for the problem to re-occur. Look to
see if any
calls to ast_context_remove_extension_callerid2 occurred (they will occur
with dial reloads-- lots of them).
You'll have to search carefully! The gdb messages could be buried in your
console output.

If the problem reoccurs, but you didn't see any calls to
ast_context_remove_extension_callerid2,
then it could be assumed that you are suffering some sort of memory
corruption.
Where it dies, or things start looking strange, may not indicate where or
why the corruption is
happening. In such a case, it really gets tricky to debug. Then we might
resort to
stuff like dmalloc, and others, to help spot where/when corruption occurs.
Let's cross that
bridge if we come to it.

murf




 Jerry




-- 

Steve Murphy

ParseTree Corporation
--
_
-- 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] Dialplan matching

2011-04-04 Thread Asterisk User
Hello all, I am trying to figure out the logic in on prefix matching for
Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
calls to 011870, 01137455 and so on.

exten = _011870.,1,Goto(intl-disabled,s,1)
exten = _01137455.,2,Goto(intl-disabled,s,1)
exten = _01137477.,3,Goto(intl-disabled,s,1)
exten = _0113749.,4,Goto(intl-disabled,s,1)
exten = _011.,5,Goto(intl-disabled,s,1)
exten = _011.,6,Playback(all-outgoing-lines-unavailable)
exten = _011.,7,Wait(1)
exten = _011.,8,Playback(please-hang-up-and-dial-operator)
exten = _011.,9,Hangup

Is this correct or should it be:

exten = _011870X,1,Goto(intl-disabled,s,1)
exten = _01137455X,2,Goto(intl-disabled,s,1)

I tried searching for definitive information on voip-wiki, nerd vittles, but
there is a lot of confusion.
--
_
-- 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] Dialplan matching

2011-04-04 Thread Steve Murphy
On Mon, Apr 4, 2011 at 8:09 AM, Asterisk User asteruserl...@gmail.comwrote:


 Hello all, I am trying to figure out the logic in on prefix matching for
 Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
 calls to 011870, 01137455 and so on.

 exten = _011870.,1,Goto(intl-disabled,s,1)
 exten = _01137455.,2,Goto(intl-disabled,s,1)
 exten = _01137477.,3,Goto(intl-disabled,s,1)
 exten = _0113749.,4,Goto(intl-disabled,s,1)
 exten = _011.,5,Goto(intl-disabled,s,1)
 exten = _011.,6,Playback(all-outgoing-lines-unavailable)
 exten = _011.,7,Wait(1)
 exten = _011.,8,Playback(please-hang-up-and-dial-operator)
 exten = _011.,9,Hangup

 Is this correct or should it be:

 exten = _011870X,1,Goto(intl-disabled,s,1)
 exten = _01137455X,2,Goto(intl-disabled,s,1)

 I tried searching for definitive information on voip-wiki, nerd vittles,
 but there is a lot of confusion.


Assuming that 011870 is followed by more than digit, normally, I'd say your
first set is more applicable.
The . in the pattern at the end means any number of digits, followed by a
timeout.
If you know the number of digits, and it is fixed, then you could use
_011870XXX or similar to avoid the timeout, and begin the Goto
immediately on reception of the final digit.

The X in the second set will match just one digit, and the Goto will be be
executed.

Does that help?




 --

Steve Murphy

ParseTree Corporation
--
_
-- 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] Dialplan matching

2011-04-04 Thread A J Stiles
On Monday 04 Apr 2011, Asterisk User wrote:
 Hello all, I am trying to figure out the logic in on prefix matching for
 Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
 calls to 011870, 01137455 and so on.

Asterisk's default behaviour is always to try the hardest-to-match expression 
first  (i.e. the exact extension number).  If there is no match there, it 
then tries progressively easier-to-match expressions; only ever trying 
something like _. if nothing else matched.

(Compare the rules of poker when wild cards are introduced:  a natural hand 
beats an otherwise-equivalent hand containing wild cards.)

-- 
AJS

Answers come *after* questions.

--
_
-- 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] Dialplan matching

2011-04-04 Thread Tilghman Lesher
On Monday 04 April 2011 09:09:28 Asterisk User wrote:
 Hello all, I am trying to figure out the logic in on prefix matching for
 Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
 calls to 011870, 01137455 and so on.
 
 exten = _011870.,1,Goto(intl-disabled,s,1)

This one is okay.

 exten = _01137455.,2,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _01137477.,3,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _0113749.,4,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _011.,5,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _011.,6,Playback(all-outgoing-lines-unavailable)
 exten = _011.,7,Wait(1)
 exten = _011.,8,Playback(please-hang-up-and-dial-operator)
 exten = _011.,9,Hangup

This looks like it should be starting from priority 1, extension s,
context [intl-disabled].

 Is this correct or should it be:
 
 exten = _011870X,1,Goto(intl-disabled,s,1)
 exten = _01137455X,2,Goto(intl-disabled,s,1)
 
 I tried searching for definitive information on voip-wiki, nerd vittles,
 but there is a lot of confusion.

The major problem in your dialplan is that you WANT to have multiple start
points, but the way you have it written, there is only ONE start point.
Everything else is simply ignored.  Extensions will only start in the
dialplan from priority 1.

-- 
Tilghman

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


  1   2   3   4   5   6   >