SV: [Asterisk-Users] Possibly a bug? (Was: Setting up calls through
themanager interface)
Bjorn
bok2 at online.no
Sat Jun 4 11:11:19 MST 2005
Confirmation not necessary. I just found that this bug has already been
reported:
http://bugs.digium.com/view.php?id=3861
-----Opprinnelig melding-----
Fra: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] På vegne av Bjorn
Sendt: 4. juni 2005 19:00
Til: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Emne: [Asterisk-Users] Possibly a bug? (Was: Setting up calls through
themanager interface)
Thanks Tony/Olle, you both answered my question. However, now I am wondering
if there might be a bug with Asterisk, or if I am simply misconfiguring
something. This is the scenario:
Taken from extensions.conf (a little simplified):
Exten => 1234,1,Queue(managerqueue)
Exten => 1234,2,Hangup
Then, telnet'ing to asterisk manager interface and issuing the following
commands:
Action: Originate
Context: default
Exten: 5555555
Channel: local/1234
Priority: 1
Now, the phone rings at the agent side and it is being picked up. The other
party answers and the call is set up. This is the output from the console:
============================================================================
-- Executing Queue("Local/1234 at default-2b04,2", "managerqueue||||60") in
new stack
-- Started music on hold, class 'default', on Local/1234 at default-2b04,2
-- outgoing agentcall, to agent '1020', on 'Local/1020 at default-6426,1'
-- Called Agent/1020
-- outgoing agentcall, to agent '1010', on 'Local/1010 at default-97ad,1'
-- Called Agent/1010
-- outgoing agentcall, to agent '1000', on 'Local/1000 at default-b6c4,1'
-- Called Agent/1000
-- Executing Dial("Local/1020 at default-6426,2", "SIP/1020") in new stack
Jun 4 18:47:22 NOTICE[12633]: app_dial.c:968 dial_exec_full: Unable to
create channel of type 'SIP' (cause 3)
== Everyone is busy/congested at this time (1:0/1/0)
-- Executing Dial("Local/1010 at default-97ad,2", "SIP/1010") in new stack
-- Called 1010
-- Executing Dial("Local/1000 at default-b6c4,2", "SIP/1000") in new stack
-- SIP/1010-a2f8 is ringing
-- Agent/1010 is ringing
-- Called 1000
-- SIP/1000-962b is ringing
-- Agent/1000 is ringing
-- SIP/1000-962b answered Local/1000 at default-b6c4,2
-- Agent/1000 answered Local/1234 at default-2b04,2
-- Playing 'queue-reporthold' (language 'en')
== Spawn extension (default, 1010, 1) exited non-zero on
'Local/1010 at default-97ad,2'
== Spawn extension (default, 1000, 1) exited non-zero on
'Local/1000 at default-b6c4,2'
-- Playing 'queue-less-than' (language 'en')
-- Playing 'digits/2' (language 'en')
-- Playing 'queue-minutes' (language 'en')
-- Stopped music on hold on Local/1234 at default-2b04,2
> Channel Local/1234 at default-2b04,1 was answered.
-- Executing SetVar("Local/1234 at default-2b04,1", "__RECSUFFIX=5555555")
in new stack
-- Executing Dial("Local/1234 at default-2b04,1", "SIP/5555555 at Outgoing")
in new stack
-- Called 5555555 at Outgoing
============================================================================
So far everything is normal. However (and this is the strange part), after
completing this call, the agent answering the call becomes unavailable. Not
logged out, just unavailable. And so he remains.
Issuing the same actions from the asterisk manager interface again will
result in the call going nowhere (if there's no other agents logged in), or
to another agent, even though the queue has wrapuptime=0 and
strategy=ringall. Even calling directly to the queue extension from an
outside line will result in the same. After a little while, the system
becomes unable to dial out, I get these messages:
============================================================================
Jun 4 18:52:12 WARNING[12633]: channel.c:341 ast_channel_alloc: Channel
allocation failed: Refusing due to active shutdown
Jun 4 18:52:12 WARNING[12633]: channel.c:341 ast_channel_alloc: Channel
allocation failed: Refusing due to active shutdown
Jun 4 18:52:12 WARNING[12633]: chan_local.c:498 local_new: Unable to
allocate channel structure
Jun 4 18:52:12 NOTICE[12633]: channel.c:1982 __ast_request_and_dial: Unable
to request channel local/1234
Jun 4 18:52:12 WARNING[12633]: channel.c:341 ast_channel_alloc: Channel
allocation failed: Refusing due to active shutdown
Jun 4 18:52:12 WARNING[12633]: pbx.c:4778 ast_pbx_outgoing_cdr_failed:
Unable to allocate channel structure for CDR record
Jun 4 18:52:34 WARNING[12633]: channel.c:341 ast_channel_alloc: Channel
allocation failed: Refusing due to active shutdown
Jun 4 18:52:34 WARNING[12633]: chan_sip.c:2342 sip_new: Unable to allocate
SIP channel structure
Jun 4 18:52:34 NOTICE[12633]: chan_sip.c:8812 handle_request_invite: Unable
to create/find channel
============================================================================
Also, after this, asterisk takes very long to stop with the stop now
command, and when it finally exits, it returns memory segmentation error (or
similar, translated to English), in addition to the well-known Yuck: Error
in buffer handling...: Broken pipe
Can anyone confirm this bug? I should add that originating a call not going
into a queue, but directly to another extension works fine.
Regards,
Bjorn
-----Opprinnelig melding-----
Fra: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] På vegne av Tony
Mountifield
Sendt: 4. juni 2005 11:36
Til: asterisk-users at lists.digium.com
Emne: [Asterisk-Users] Re: Setting up calls through the manager interface
In article <8357030.1117828274649.JavaMail.adm-moff at moffice11.nsc.no>,
Bjorn <bok2 at online.no> wrote:
> -=-=-=-=-=-
>
> Hello all!
>
> I am currently making a script which is supposed to set up a call on
request from a user,
> say, through a web page, for support issues etc. I am new into both
asterisk and php, but I
> am working my way through the path as good as I can.
>
> Basically, what I would want to do, is to give the user the possibility to
initiate a call
> by clicking a button. I?ve seen a cgi-alternative for this, but I would
prefer it in PHP,
> furthermore, extend the functionality of this a bit:
>
> Imagine, the user clicks a button to initiate a call. The script is called
and establish a
> connection to the manager interface. So far so good.
>
> The script will first call a support representative on the inside, and,
when answered, it
> will proceed with calling the customer. If there was only one support
representative, this
> could easily have been accomplished by executing the following:
>
> action: originate
> context: local
> exten: 555-4343
> priority: 1
> channel: SIP/1234
>
> ? where channel would be the support rep.?s number. However, when there?s
more than one,
> you?d prefer to have the calls routed to whoever is available. This is
nicely fixed in the
> queue system, where the support representatives can log on and off, the
calls goes to first
> available representative etc. I suppose two alternatives would be the most
common ones here,
> to have the phone ring at all available channels within a ?support group?
at the same time,
> or have the call distributed randomly and (preferably) transferred to
another agent if it
> turns out there was no answer at the first representative.
>
> I tried to achieve this by the following:
>
>
> action: originate
> context: local
> exten: 555-4343
> priority: 1
> channel: SIP/1234
> channel: SIP/2345
No, you need to use the "Local" channel type. So as not to confuse
between labels I'll use a different name for the contexts. So in
extensions.conf you might have something like this:
[internal]
exten => _1XXX,1,Dial(SIP/${EXTEN})
exten => _1XXX,2,NoOp(DIALSTATUS=${DIALSTATUS})
exten => _1XXX,3,Hangup
[external]
exten => _X.,1,Dial(SIP/${EXTEN}@provider)
exten => _X.,2,NoOp(DIALSTATUS=${DIALSTATUS})
exten => _X.,3,Hangup
Then if you wanted to dial your internal extension of 1234 and
when answered connect them to the outside number 0123456789,
through the manager API you do the following:
Action: Originate
Channel: Local/1234 at internal
Context: external
Exten: 0123456789
Priority: 1
See http://www.voip-info.org/wiki-Asterisk+Local+channels for more info.
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list