[asterisk-users] Problem: features (from features.conf) not available if call was originated by manager API or call file

2007-10-17 Thread Volker Sauer
Hello asterisk-users,

I setup my asterisk to support several features like
automon,blindxfer,atxfer,parkcall etc. by using features.conf and the
global variable
DYNAMIC_FEATURES=automon#blindxfer#atxfer#parkcall#disconnect in
extension.conf. Every Dial() command in my diaplan has the appropriate
parameters out of {tTkWwW}.
For calls from my SIP phones everything works fine. Pressing #1 will
transfer, pressing ## will automon and so on.

But if I originate the call from either a call file (which is used by a
callback application on my setup) or the manager api (which is used by a
webadressbook, which automatically dials and connects to the phone on
your desk) these features are not available even the manager api jumps
to the same context as a normal call from a phone and uses the same
Dial() command with {tTwWkK}. This means, that alle the nice feature
keys which normally work do not if I originate the call over the
webfrontend.
Therefore, either the global variable is not known to the call which
came from the call file or the manager api or something else is going
wrong.

Here's my call file:

Channel: SIP/tol/06151154260
Account: t-online
CallerID: 03222XXX 03222XXX
MaxRetries: 4
RetryTime: 15
WaitTime: 60
Context: doCallBackVolkerStage2
Extension: s
Priority: 1

(the Context doCallBackVolkerStage2 will run DISA).

and that's the PHP code orgiginating the calls:

$socket = fsockopen(127.0.0.1,5038, $errno, $errstr, $timeout);
fputs($socket, Action: Login\r\n);
fputs($socket, UserName: webdial\r\n);
fputs($socket, Secret: XX\r\n\r\n);
fputs($socket, Action: Originate\r\n);
fputs($socket, Channel: $channel\r\n);
fputs($socket, Exten: $tonumber\r\n);
fputs($socket, CallerID: $callerid\r\n);
fputs($socket, Context: doLocalCalls\r\n);
fputs($socket, MaxRetries: 1\r\n);
fputs($socket, RetryTime: 15\r\n);
fputs($socket, WaitTime: 60\r\n);
fputs($socket, Priority: 1\r\n\r\n);
fputs($socket, SetLanguage: de\r\n\r\n);
fputs($socket, Action: Logoff\r\n\r\n);

(the Context doLocalCalls is the same as on any other SIP phone. It will run 
Dial().

Any hint on what I'm doing wrong or where to check else?

Regards
Volker



signature.asc
Description: Digital signature
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

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

Re: [asterisk-users] Problem: features (from features.conf) not available if call was originated by manager API or call file

2007-10-17 Thread Atis Lezdins
On Sunday 14 October 2007 15:02:43 Volker Sauer wrote:
 Hello asterisk-users,

 I setup my asterisk to support several features like
 automon,blindxfer,atxfer,parkcall etc. by using features.conf and the
 global variable
 DYNAMIC_FEATURES=automon#blindxfer#atxfer#parkcall#disconnect in
 extension.conf. Every Dial() command in my diaplan has the appropriate
 parameters out of {tTkWwW}.
 For calls from my SIP phones everything works fine. Pressing #1 will
 transfer, pressing ## will automon and so on.

 But if I originate the call from either a call file (which is used by a
 callback application on my setup) or the manager api (which is used by a
 webadressbook, which automatically dials and connects to the phone on
 your desk) these features are not available even the manager api jumps
 to the same context as a normal call from a phone and uses the same
 Dial() command with {tTwWkK}. This means, that alle the nice feature
 keys which normally work do not if I originate the call over the
 webfrontend.
 Therefore, either the global variable is not known to the call which
 came from the call file or the manager api or something else is going
 wrong.

If it's a global variable, and it works one way, but not another - then you 
should post a bug.

You can also try using in your call file:

Set: DYNAMIC_FEATURES=automon#...

If this doesn't help either, you can dial to Local channel, and there execute 
a Dial(), and set variables if necessary.

Regards,
Atis


-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] Problem: features (from features.conf) not available if call was originated by manager API or call file

2007-10-17 Thread Volker Sauer
On Mi, 17 Okt 2007, Atis Lezdins [EMAIL PROTECTED] wrote:
 
 If it's a global variable, and it works one way, but not another - then you 
 should post a bug.

Yes, maybe it's a bug. But I'm not sure. I still think I'm missing a
detail

 You can also try using in your call file:
 Set: DYNAMIC_FEATURES=automon#...

Let's focus on the manager API because this is my primary building
site and the call files are not that important.

I tried the following:

[EMAIL PROTECTED]: ~  telnet localhost 5038
Action: Login
UserName: webdial
Secret: X

Response: Success
Message: Authentication accepted

Action: Getvar
Variable: DYNAMIC_FEATURES

Response: Success
Variable: DYNAMIC_FEATURES
Value: automon#blindxfer#atxfer#parkcall#disconnect


Well, that means that the global variable is known in this context (as
it should be). But if I run:


Action: Originate
Channel: SIP/cisco1
Exten: 201
Context: doLocalCalls
MaxRetries: 1
RetryTime: 15
WaitTime: 60
Priority: 1
SetLanguage: de

The called party can listen to DTMF instead of asterisk triggering
atxfer or so.

That's what the CLI says:

  == Parsing '/opt/asterisk/etc/asterisk/manager.conf': Found
  == Manager 'webdial' logged on from 127.0.0.1
Channel SIP/cisco1-08247f88 was answered.
-- Executing [EMAIL PROTECTED]:1] Goto(SIP/cisco1-08247f88, 
doRemoteCalls|201|1) in new stack
-- Goto (doRemoteCalls,201,1)
-- Executing [EMAIL PROTECTED]:1] Goto(SIP/cisco1-08247f88, 
Dial-Default|XXX|1) in new stack
-- Goto (Dial-Default,06151154260,1)
-- Executing [EMAIL PROTECTED]:1] Macro(SIP/cisco1-08247f88, 
Dial-Tol|XXX) in new stack
-- Executing [EMAIL PROTECTED]:1] Set(SIP/cisco1-08247f88, 
CALLERID(name)=) in new stack
-- Executing [EMAIL PROTECTED]:2] ExecIf(SIP/cisco1-08247f88, 
0|SIPAddHeader|Privacy: header) in new stack
-- Executing [EMAIL PROTECTED]:3] Set(SIP/cisco1-08247f88, 
CDR(accountcode)=t-online) in new stack
-- Executing [EMAIL PROTECTED]:4] Dial(SIP/cisco1-08247f88, 
SIP/tol/XXX||KTW) in new stack
-- Called tol/XX
-- SIP/tol-08240f78 is making progress passing it to SIP/cisco1-08247f88
-- SIP/tol-08240f78 is ringing
-- SIP/tol-08240f78 is making progress passing it to SIP/cisco1-08247f88
-- SIP/tol-08240f78 answered SIP/cisco1-08247f88


You see I run Dial with the KTW options. 
*Maybe* in this case, my phone is not the caller but the called 
because it get's called  by the manager API (I don't know how one has
to see that). To check, I dialed with ktwKTW - same result. If I 
dial with the normal phone, #2 for atxfer works. If I dial with the 
manager API, it doesn't.

I even tried to set the variable in the manager API. The CLI says:
== Setting global variable 'DYNAMIC_FEATURES' to
  'automon#blindxfer#atxfer#parkcall#disconnect'

but the result is the same. No features like #2.


 If this doesn't help either, you can dial to Local channel, and there execute 
 a Dial(), and set variables if necessary.

I tried both, but neither worked.
First I tought chan_local would solve it because I can explicitly set
Dial-parameters. But:

  == Manager 'webdial' logged on from 127.0.0.1
-- Executing [EMAIL PROTECTED]:1] Macro(Local/[EMAIL PROTECTED],2, 
intDial|SIP/cisco2) in new stack
-- Executing [EMAIL PROTECTED]:1] Dial(Local/[EMAIL PROTECTED],2, 
SIP/cisco2||kKwWtTj) in new stack
-- Called cisco2
-- SIP/cisco2-08247f88 is ringing
-- SIP/cisco2-08247f88 answered Local/[EMAIL PROTECTED],2
Channel Local/[EMAIL PROTECTED],1 was answered.
  == Manager 'webdial' logged off from 127.0.0.1
-- Executing [EMAIL PROTECTED]:1] Goto(Local/[EMAIL PROTECTED],1, 
doRemoteCalls|201|1) in new stack
-- Goto (doRemoteCalls,201,1)
-- Executing [EMAIL PROTECTED]:1] Goto(Local/[EMAIL PROTECTED],1, 
Dial-Default|XXX|1) in new stack
-- Goto (Dial-Default,06151154260,1)
-- Executing [EMAIL PROTECTED]:1] Macro(Local/[EMAIL PROTECTED],1, 
Dial-Tol|XXX) in new stack
-- Executing [EMAIL PROTECTED]:1] Set(Local/[EMAIL PROTECTED],1, 
CALLERID(name)=) in new stack
-- Executing [EMAIL PROTECTED]:2] ExecIf(Local/[EMAIL PROTECTED],1, 
0|SIPAddHeader|Privacy: header) in new stack
-- Executing [EMAIL PROTECTED]:3] Set(Local/[EMAIL PROTECTED],1, 
CDR(accountcode)=t-online) in new stack
-- Executing [EMAIL PROTECTED]:4] Dial(Local/[EMAIL PROTECTED],1, 
SIP/tol/XXX||ktwKTW) in new stack
-- Called tol/06151154260
  == Spawn extension (macro-intDial, s, 1) exited non-zero on 'Local/[EMAIL 
PROTECTED],2' in macro 'intDial'
  == Spawn extension (macro-intDial, s, 1) exited non-zero on 'Local/[EMAIL 
PROTECTED],2'
-- SIP/tol-08240f78 is making progress passing it to SIP/cisco2-08247f88
-- SIP/tol-08240f78 is ringing
-- SIP/tol-08240f78 is making progress passing it to SIP/cisco2-08247f88
-- SIP/tol-08240f78 answered SIP/cisco2-08247f88

Now, the phone and the remote party are called