Re: [asterisk-users] Dial() after the h extension has been invoked?

2021-11-13 Thread Antony Stone
On Friday 12 November 2021 at 23:34:25, Steve Edwards wrote:

> On Fri, 12 Nov 2021, Antony Stone wrote:
> > I've never used AGI, so what would your suggested solution involve?
> 
> If all you need is to update/insert/delete some rows in a database, ODBC
> could be a solution.

I already use ODBC for that purpose, and it works well.

However, in this case it's the Asterisk internal database, purely local to the 
machine, which needs manipulating.


Antony.

-- 
#define SIX 1+5
#define NINE 8+1

int main() {
printf("%d\n", SIX * NINE);
}
- thanks to ECB for bringing this to my attention

   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

Re: [asterisk-users] Dial() after the h extension has been invoked?

2021-11-12 Thread Steve Edwards

On Fri, 12 Nov 2021, Steve Edwards wrote:

I prefer to do database work in an AGI. I find quoting within the database to 
be obtuse and fragile.


s/database/dialplan/g

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- 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] Dial() after the h extension has been invoked?

2021-11-12 Thread Steve Edwards

On Fri, 12 Nov 2021, Antony Stone wrote:


I've never used AGI, so what would your suggested solution involve?


If all you need is to update/insert/delete some rows in a database, ODBC 
could be a solution.


I prefer to do database work in an AGI. I find quoting within the database 
to be obtuse and fragile. Also, I find error handling better in an AGI 
with a real programming language. Also, also, things start with 'I just 
need to do x' and frequently grow to 2SLGBTQQIA+x and you will wish you 
started with a real programming language.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- 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] Dial() after the h extension has been invoked?

2021-11-12 Thread Antony Stone
On Friday 12 November 2021 at 18:08:11, aster...@phreaknet.org wrote:

> On 11/12/2021 12:39 PM, Antony Stone wrote:
> > On Friday 12 November 2021 at 17:36:07, Eric Wieling wrote:
> >> Create a spool file from the 'h' extension to generate the call.
> > 
> > Yes, I thought of that, but it somehow feels a bit clunky, and was hoping
> > for a neater solution :)
> 
> Use Originate() instead of spooling a call file, so it's a single line
> of dialplan. Much less clunky :)

Originate() does not support special SIP headers :(


Antony.

-- 
Wanted: telepath.   You know where to apply.

   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

Re: [asterisk-users] Dial() after the h extension has been invoked?

2021-11-12 Thread Antony Stone
On Friday 12 November 2021 at 18:18:03, Eric Wieling wrote:

> On 11/12/21 12:39, Antony Stone wrote:
> > On Friday 12 November 2021 at 17:36:07, Eric Wieling wrote:
> >> Create a spool file from the 'h' extension to generate the call.
> > 
> > Yes, I thought of that, but it somehow feels a bit clunky, and was hoping
> > for a neater solution :)
> 
> Dialing post call to update a database is clunky.  The solutions will be
> clunky too.
> 
> I use a hangup handler with an AGI script.  The script makes a database
> connection to close out the call.  Much cleaner.

Would you care to give a little more in the way of detail?

I've never used AGI, so what would your suggested solution involve?


Antony.

-- 
She did not swoon, but she did get a look on her face that said 'This 
conversation is over', which Jack took as a sign he was going in the right 
direction.

 - Neal Stephenson, Quicksilver

   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

Re: [asterisk-users] Dial() after the h extension has been invoked?

2021-11-12 Thread Steve Edwards

On Fri, 12 Nov 2021, Antony Stone wrote:

Can anyone suggest how I might be able to do this?  I need to perform a 
Dial() command after an inbound channel has hung up.  I do not expect 
the Dial() to bridge to anything (the context being dialled simply does 
some database manipulation and then hangs up without even bothering to 
answer).


Any suggestions welcome :)


How about creating a call file in the h extension?

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- 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] Dial() after the h extension has been invoked?

2021-11-12 Thread Antony Stone
On Friday 12 November 2021 at 17:36:07, Eric Wieling wrote:

> Create a spool file from the 'h' extension to generate the call.

Yes, I thought of that, but it somehow feels a bit clunky, and was hoping for 
a neater solution :)


Antony.

-- 
Software development can be quick, high quality, or low cost.

The customer gets to pick any two out of three.

   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

Re: [asterisk-users] Dial() after the h extension has been invoked?

2021-11-12 Thread Eric Wieling

Create a spool file from the 'h' extension to generate the call.

On 11/12/21 11:56, Antony Stone wrote:

Hi.

I have a setup which comprises some "front-end" Asterisk servers which have
SIP trunks to external providers, and very simple dial plans, and some "back-
end" servers which only talk to the front-end machines, and have the majority
of my dialplan logic on them.

I use Dial() commands with custom SIP headers to pass information (eg: about
the current state of a call) between the front-end and back-end machines, and
this works very well.

However, I can't use a Dial() command in the h extension to notify the other
machines that a call has ended and they can now delete their state information
about that call.  If I try to, I get the error:

app_dial.c:2245 in dial_exec_full: Caller hung up before dial.

I guess i can see why Asterisk complains about being asked to Dial() after the
inbound call leg has ended, but in this case I have a reason for doing so.

Can anyone suggest how I might be able to do this?  I need to perform a Dial()
command after an inbound channel has hung up.  I do not expect the Dial() to
bridge to anything (the context being dialled simply does some database
manipulation and then hangs up without even bothering to answer).


Any suggestions welcome :)


Antony.



--
http://help.nyigc.net/

--
_
-- 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] Dial() after the h extension has been invoked?

2021-11-12 Thread Antony Stone
On Friday 12 November 2021 at 17:20:39, Frank Vanoni wrote:

> On Fri, 2021-11-12 at 16:56 +, Antony Stone wrote:
> > I use Dial() commands with custom SIP headers to pass information
> > (eg: about the current state of a call) between the front-end and back-end
> > machines, and this works very well.
> > 
> >  I need to perform a Dial() command after an inbound channel has hung up. 
> >  I do not expect the Dial() to bridge to anything (the context being
> >  dialled simply does some database manipulation and then hangs up without
> >  even bothering to answer).
> > 
> > 
> > Any suggestions welcome :)
> 
> Maybe you can use the "g" option in the first Dial(...) and proceed in
> the dial plan with the second Dial(...)

Hm, in fact I am already using the g option, because I want to detect channel 
states such as Unavailable and Congestion (in which case I try an alternative 
route to dial out with).

I suppose if I detect the DIALSTATUS is ANSWER then I know the call got 
answered and has now ended.

Sounds good - thank you :)


Antony.

-- 
I wasn't sure about having a beard at first, but then it grew on me.

   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

Re: [asterisk-users] Dial() after the h extension has been invoked?

2021-11-12 Thread Frank Vanoni
On Fri, 2021-11-12 at 16:56 +, Antony Stone wrote:

> I use Dial() commands with custom SIP headers to pass information
> (eg: about 
> the current state of a call) between the front-end and back-end
> machines, and 
> this works very well.
> 
>  I need to perform a Dial() 
> command after an inbound channel has hung up.  I do not expect the
> Dial() to 
> bridge to anything (the context being dialled simply does some
> database 
> manipulation and then hangs up without even bothering to answer).
> 
> 
> Any suggestions welcome :)


Maybe you can use the "g" option in the first Dial(...) and proceed in
the dial plan with the second Dial(...)

g - Proceed with dialplan execution at the next priority in the current
extension if the destination channel hangs up.

Example:

exten => 1234,1,Dial(SIP/deskphone,120,g)
same => n,Dial(SIP/cordlessphone)
same => n,Hangup()

Extension 1234 dials a deskphone. If "deskphone" answer... bla bla
bla... and after "deskphone" hangs up, the "cordlessphone" is dialed.








-- 
_
-- 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] Dial() after the h extension has been invoked?

2021-11-12 Thread Antony Stone
Hi.

I have a setup which comprises some "front-end" Asterisk servers which have 
SIP trunks to external providers, and very simple dial plans, and some "back-
end" servers which only talk to the front-end machines, and have the majority 
of my dialplan logic on them.

I use Dial() commands with custom SIP headers to pass information (eg: about 
the current state of a call) between the front-end and back-end machines, and 
this works very well.

However, I can't use a Dial() command in the h extension to notify the other 
machines that a call has ended and they can now delete their state information 
about that call.  If I try to, I get the error:

app_dial.c:2245 in dial_exec_full: Caller hung up before dial.

I guess i can see why Asterisk complains about being asked to Dial() after the 
inbound call leg has ended, but in this case I have a reason for doing so.

Can anyone suggest how I might be able to do this?  I need to perform a Dial() 
command after an inbound channel has hung up.  I do not expect the Dial() to 
bridge to anything (the context being dialled simply does some database 
manipulation and then hangs up without even bothering to answer).


Any suggestions welcome :)


Antony.

-- 
90% of networking problems are routing problems.
9 of the remaining 10% are routing problems in the other direction.
The remaining 1% might be something else, but check the routing anyway.

   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