[HELP]: Agents do not ring after transferring call

Hello all,

I have researched this problem as thoroughly as I know how and I have not found any information on this specific issue. I have registered here in the hopes that someone might be able to help diagnose some very peculiar behavior.

I am running Asterisk 1.4.18 in a production environment. All users have either a Linksys SPA941 or SPA942 IP phone. We run a dynamic agent setup where reps login to a main call queue set to a ringall strategy.

Here is a breakdown of the problem:

  1. A call comes in from the main queue.
  2. Agent A answers the call, but the caller request to speak with Agent B.
  3. Agent A conducts a transfer (attended/blind doesn’t seem to matter) to Agent B.
  4. Agent B takes the call and is now speaking with the caller.
  5. We now arrive at the problem: as long as Agent B is still on that same transferred call, Agent A’s phone will not ring when another call comes in from the queue.

This does not occur if direct extensions are used, only when calls come in through the queue. Is anyone familiar with this behavior? If so, I would very much appreciate any information on how I can correct this.

The desired behavior is of course for Agent A’s phone to ring when another call comes in from the queue, even if Agent B is still on the transferred call.

What does sip show inuse say for the extesnions and have you set the limits correctly ?

Thanks for responding. We run a peered setup with two Asterisk boxes; one in a datacenter close to our SIP provider, and one here in our local office (so we don’t have to go through the datacenter for local extension dialing). The local box handles the extensions, seen below in the output of ‘sip show peers’:

voip1*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status Realtime 951/951 192.168.90.217 D N 5060 OK (19 ms) 901/901 192.168.90.247 D N 5060 OK (19 ms) 103/103 192.168.90.245 D N 5060 OK (14 ms) 701/701 192.168.90.250 D N 5060 OK (16 ms) 920/920 192.168.90.200 D N 5060 OK (9 ms) 702/702 192.168.90.238 D N 5060 OK (11 ms) 503/503 192.168.90.241 D N 5060 OK (10 ms) 401/401 192.168.90.249 D N 5060 OK (18 ms) 105/105 192.168.90.233 D N 5060 OK (11 ms) 999/999 192.168.90.254 D N 5060 OK (18 ms) 906/906 192.168.90.226 D N 5060 OK (19 ms) 108/108 192.168.90.239 D N 5060 OK (9 ms) 403/403 192.168.90.243 D N 5060 OK (19 ms) 950/950 192.168.90.240 D N 5060 OK (10 ms) 902/902 192.168.90.253 D N 5060 OK (24 ms) 501/501 192.168.90.242 D N 5060 OK (12 ms) 101/101 192.168.90.248 D N 5060 OK (19 ms) 402/402 192.168.90.234 D N 5060 OK (8 ms) 102/102 192.168.90.246 D N 5060 OK (16 ms) 106/106 192.168.90.236 D N 5060 OK (11 ms) 109/109 192.168.90.237 D N 5060 OK (12 ms) 404/404 192.168.90.244 D N 5060 OK (20 ms) 405/405 192.168.90.232 D N 5060 OK (10 ms) 23 sip peers [Monitored: 23 online, 0 offline Unmonitored: 0 online, 0 offline]

Only about 3 to 5 of these are actively logged into the queue at any given time.

‘sip show inuse’ on the local box produces no useful output; however our main datacenter box shows:

[code]voip1*CLI> sip show inuse

  • User name In use Limit
    main-sip1 1 100
    vonage4 0 100
    vonage3 0 100
    vonage2 0 100
    vonage1 0 100
  • Peer name In use Limit
    main-sip1 2/0 100
    vonage4 0/0 100
    vonage3 0/0 100
    vonage2 0/0 100
    vonage1 0/0 100[/code]

It appears as though we are well within our limits, which seem to be set correctly.

How do you mean " no useful output" you should have an entry for all extensions , and what you need to do is run the command after a call is transfered and see what it thinks

Ian

[quote=“ianplain”]How do you mean " no useful output" you should have an entry for all extensions , and what you need to do is run the command after a call is transfered and see what it thinks

Ian[/quote]

This is what I mean by “no useful output”:

voip1*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit

Again, this output is from the local box which handles the extensions. I ran the ‘sip show inuse’ command both before & after a transferred call and received the same results.

Just to clarify, we have two Asterisk boxes…

  1. Our main * box is in a remote datacenter. It handles everything going to and coming from the PSTN.
  2. Our local * box is in our office. It handles the IP phone extensions and allows us to dial local extensions directly without having calls routed through the remote datacenter.

The two boxes are peered via IAX2.

I apologize for not including the following information in my initial post, but I did not set this system up and I am learning more about it as I go along.

In any case, it appears as though that when a call transfer is initiated via the IP phone’s transfer key, an AGI script is invoked which handles the extension dialing. Here is the AGI script itself:

#!/usr/bin/perl
### Setup Variables
$location = 'dtw1'; #Our Location
$context = 'sps-internal'; #Default Context to pass to
$mode = 'server'; ## 'client' or 'server' - Server is master hub (DTW1) and where Voicemail is stored
$voicemail_server = 'dtw1-srq1';
$voicemail_context = 'voicemail-unavail';

use DBI;
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
%AGIData = $AGI->ReadParse();
$exten = $AGI->get_variable('EXTEN');
if ($exten eq '#') {
  $exten = $AGI->get_variable('TOEXTEN');
}
$dsn = "DBI:mysql:asterisk:localhost";
$dbh = DBI->connect($dsn, 'root', '');

## Setup sub to do Voicemail Stuff
sub Do_VM {
  if ($mode eq 'server') {
    $AGI->exec('MailboxExists',$exten.'@sps-internal|u');
    if ($AGI->get_variable('VMBOXEXISTSSTATUS') eq 'FAILED') {
      $AGI->exec('playback','sorry');
      $AGI->exec('playback','the-mailbox');
      $AGI->say_digits($exten);
      $AGI->exec('playback','T-is-not-available');
    } else {
      $AGI->exec('Voicemail',$exten.'@sps-internal|us');
    }
    $AGI->exec('hangup');
    exit(0);
  } elsif ($mode eq 'client') {
    $AGI->exec('Dial','IAX2/'.$voicemail_server.'-'.$location.'/'.$exten.'@'.$voicemail_context);
    $AGI->hangup();
    exit(0);
  }
}

$sth = $dbh->prepare("SELECT `location` FROM `routing-db` WHERE `id`='$exten' LIMIT 1");
$sth->execute;
@row = $sth->fetchrow_array();
$sth->finish;
$dbh->disconnect();
if ($location eq $row[0]) {
  # We can reach this extension locally, call via SIP
  $AGI->exec('ChanIsAvail',"SIP/$exten");
  $dial = 'SIP/'.$exten;
} elsif ($row[0]) {
  # This extension is not on our system, but exists, so we'll pass it to where we found it
  if ($mode eq 'server') {
    $AGI->exec('ChanIsAvail','IAX2/'.$location.'-'.$row[0]);
    $dial = 'IAX2/'.$location.'-'.$row[0].'/'.$exten.'@'.$context;
  } elsif ($mode eq 'client') {
    $AGI->exec('ChanIsAvail','IAX2/'.$row[0].'-'.$location);
    $dial = 'IAX2/'.$row[0].'-'.$location.'/'.$exten.'@'.$context;
  }
} else {
  # This extension does not exist
  $AGI->verbose($exten.' Invalid Extension',3);
  $AGI->exec('playback','pbx-invalid');
  exit(0);
}
if ($AGI->get_variable('AVAILCHAN') eq '') {
  # Their site can not be reached, passing to VoiceMail / Error Out
  if ($mode eq 'server') {
    Do_VM();
  } elsif($mode eq 'client') {
    # Be a bit comical with errors when we can't reach the VM server
    $AGI->exec('playback','cannot-complete-network-error');
    $AGI->exec('playback','infuriate-tech-staff');
    $AGI->say_alpha('##*#*###*#*');
    $AGI->hangup();
    exit(0);
  }
} else {
  # Ring extension for 30 seconds, then pass to VM
  $AGI->exec('Dial',$dial.'|30');
  $status = $AGI->get_variable('DIALSTATUS');
  if ($status eq 'ANSWER') {
    ## This call was answered! Good! now hangup!
    $AGI->hangup();
    exit(0);
  } else {
    ## This call was NOT answered, Send to Voicemail!
    Do_VM();
  }
}

Right now, we’re in the middle of the business day and are experiencing a heavy call volume, so it is very difficult to trap the relevant CLI output when a transfer takes place. I am working on that and will post it ASAP.

Hi

OK you need to set up the limits on the local box.

taken from the upgrade notes:-

[quote]* Queues depend on the channel driver reporting the proper state
for each member of the queue. To get proper signalling on
queue members that use the SIP channel driver, you need to
enable a call limit (could be set to a high value so it
is not put into action) and also make sure that both inbound
and outbound calls are accounted for.

Example:

   [general]
   limitonpeer = yes

   [peername]
   type=friend
   call-limit=10

[/quote]

Ian

[quote=“ianplain”]Hi

OK you need to set up the limits on the local box.

taken from the upgrade notes:-

[quote]* Queues depend on the channel driver reporting the proper state
for each member of the queue. To get proper signalling on
queue members that use the SIP channel driver, you need to
enable a call limit (could be set to a high value so it
is not put into action) and also make sure that both inbound
and outbound calls are accounted for.

Example:

   [general]
   limitonpeer = yes

   [peername]
   type=friend
   call-limit=10

[/quote]

Ian[/quote]

Thanks very much, Ian. What you say makes sense, so I opened up sip.conf on the local box to add what you suggested and found that none of the SIP extensions are there; in fact, there’s nothing in it at all except for the default text. Am I editing the wrong file?

Hi Must have an include or are you using users.conf.

Is this a packaged system ?

[quote=“ianplain”]Hi Must have an include or are you using users.conf.

Is this a packaged system ?[/quote]

No, this system was compiled from source, but it has been heavily modified to suit the business where it is implemented. I am having a tough time sorting out all the numerous customizations, and the fact that it is a peered system complicates things.

At the moment I am unable to determine exactly how the SIP phone peers are being set. They show up when the ‘sip show peers’ command is issued, but I see no entries for these IP phones in either sip.conf or users.conf on the local box. Is there another way to specify SIP peers, perhaps some sort of DB-driven dynamic way?

Hi

Could be realtime, you need to get the documentation for the peopel who set it up realy. try

“grep -li 951 *”

when in /etc/asterisk and see if that throws up any files

Ian

[quote=“ianplain”]Hi

Could be realtime, you need to get the documentation for the peopel who set it up realy. try

“grep -li 951 *”

when in /etc/asterisk and see if that throws up any files

Ian[/quote]

Yeah, I was thinking the same thing… unfortunately though, there is no documentation for this setup whatsoever, so I have had to really put on the sleuthing cap to figure this out.

Anyway, I found that the local SIP peers (our IP phones) were specified in a MySQL DB which extconfig.conf pointed to. I edited sip.conf general settings on both boxes to include ‘limitonpeers=yes’, and in the local SIP peer table I added a column ‘call-limit’ which is set to 10 for all local peers.

Here is the new output of ‘sip show settings’ on the local box:

Global Settings:
----------------
  SIP Port:               5060
  Bindaddress:            0.0.0.0
  Videosupport:           No
  AutoCreatePeer:         No
  Allow unknown access:   Yes
  Allow subscriptions:    Yes
  Allow overlap dialing:  Yes
  Promsic. redir:         No
  SIP domain support:     No
  Call to non-local dom.: Yes
  URI user is phone no:   No
  Our auth realm          asterisk
  Realm. auth:            No
  Always auth rejects:    No
  Call limit peers only:  Yes
  Direct RTP setup:       No
  User Agent:             Asterisk PBX
  MWI checking interval:  10 secs
  Reg. context:           (not set)
  Caller ID:              asterisk
  From: Domain:
  Record SIP history:     Off
  Call Events:            Off
  IP ToS SIP:             unknown
  IP ToS RTP audio:       unknown
  IP ToS RTP video:       unknown
  T38 fax pt UDPTL:       No
  RFC2833 Compensation:   No
  SIP realtime:           Enabled

Note that ‘Call limit peers only: yes’ implies that the global sip config changes were successful. Here is the new output of ‘sip show inuse’ on the local box:

voip1*CLI> sip show inuse
* User name               In use          Limit
102                       0               10
103                       0               10
503                       0               10
* Peer name               In use          Limit
503                       0/0             10
103                       1/0             10
403                       0/0             10
105                       0/0             10
951                       0/0             10
501                       0/0             10
404                       0/0             10
902                       0/0             10
920                       0/0             10
702                       0/0             10
102                       0/0             10
109                       0/0             10
999                       0/0             10
701                       0/0             10
401                       0/0             10
901                       0/0             10
405                       0/0             10
108                       0/0             10
950                       0/0             10
402                       0/0             10
106                       0/0             10
101                       0/0             10
906                       0/0             10

The call-limit specified for each peer looks to have taken as well.

I am about to conduct some tests to see if any of this actually made a difference… I’ll let you know what happens. Thanks very much for all your help, Ian.

No dice. Agents still do not ring when a call comes in from the queue while another agent is on a call they transferred.

I have set limitonpeers=yes, specified a call-limit for each peer… At this point I have no idea what else I can do. Am I missing something?

Does this have to do with Packet2Packet bridging of SIP calls? It seems that somehow the agent who transferred the call is remaining tied to the call after transferring…

Hi

First thing, Go back to who sold the system and demand docs.

Now thats out of the way.

setup a call transfer it then so a sip show channels and see whats tied to what ?

Also what phones are you using ? and have you tried native asterisk transfers ie # to transfer

Ian

[quote=“ianplain”]Hi

First thing, Go back to who sold the system and demand docs.

Now thats out of the way.

setup a call transfer it then so a sip show channels and see whats tied to what ?

Also what phones are you using ? and have you tried native asterisk transfers ie # to transfer

Ian[/quote]

I wish I could do that, believe me… but like I said before, this is not a packaged/sold system. It was setup from scratch & compiled from source by the former head of IT, whom I have replaced. He did not bother to document anything… you should see the rest of the codebase for our other systems. Hardly any comments, cryptic variable names… it’s a nightmare.

In any case, here’s the CLI logger output of the transfer taking place. I am getting transferred from extension 106 to 102 after coming in from the queue:

    -- Started music on hold, class 'default', on IAX2/dtw1-srq1-14
    -- Executing [s@sps-internal:1] Dial("SIP/106-b4a07560", "IAX2/dtw1-srq1/s") in new stack
    -- Called dtw1-srq1/sels
[Sep  3 14:37:04] WARNING[2532]: chan_iax2.c:7542 socket_process: Call rejected by 69.39.66.237: No such context/extension
    -- Hungup 'IAX2/dtw1-srq1-8'
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@sps-internal:2] Hangup("SIP/106-b4a07560", "") in new stack
  == Spawn extension (sps-internal, s, 2) exited non-zero on 'SIP/106-b4a07560'
    -- Executing [h@sps-internal:1] Dial("SIP/106-b4a07560", "IAX2/dtw1-srq1/h") in new stack
    -- Called dtw1-srq1/hels
    -- Hungup 'IAX2/dtw1-srq1-9'
  == Spawn extension (sps-internal, h, 1) exited non-zero on 'SIP/106-b4a07560'
    -- Executing [102@sps-internal:1] AGI("SIP/106-b4a24760", "dial-exten.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/dial-exten.agi
    -- AGI Script Executing Application: (ChanIsAvail) Options: (SIP/102)
    -- AGI Script Executing Application: (Dial) Options: (SIP/102|30)
    -- Called 102ow channels
    -- SIP/102-0083aec0 is ringing
    -- Stopped music on hold on IAX2/dtw1-srq1-14
  == Spawn extension (srq1-direct, 106, 1) exited non-zero on 'SIP/106-b4a24760<ZOMBIE>'
    -- Hungup 'IAX2/dtw1-srq1-3'
  == Spawn extension (sps-internal, 17026334551, 1) exited non-zero on 'SIP/103-b4a17b50'
    -- Executing [h@sps-internal:1] Dial("SIP/103-b4a17b50", "IAX2/dtw1-srq1/h") in new stack
    -- Called dtw1-srq1/hels
    -- Hungup 'IAX2/dtw1-srq1-18'
  == Spawn extension (sps-internal, h, 1) exited non-zero on 'SIP/103-b4a17b50'
    -- SIP/102-0083aec0 answered IAX2/dtw1-srq1-14

And here is the output from ‘sip show channels’ while on the transferred call:

voip1*CLI> sip show channels
Peer             User/ANR    Call ID      Seq (Tx/Rx)  Format           Hold     Last Message
192.168.90.233   (None)      310fa6c9-24  00101/164687  0x0 (nothing)    No       Rx: REGISTER
192.168.90.246   102         5ecdec6d162  00102/00000  0x3f0004 (ulaw|  No       Tx: ACK
192.168.90.246   102         0fc6e30f648  00101/00000  0x0 (nothing)    No
192.168.90.236   106         b9f4f2d0-c2  00101/00102  0x0 (nothing)    No       Rx: ACK
192.168.90.242   (None)      a2df589e-76  00101/70758  0x0 (nothing)    No       Rx: REGISTER
192.168.90.236   106         4cd24b8-613  00101/00102  0x0 (nothing)    No       Rx: ACK
192.168.90.244   (None)      9ba66c47-a4  00101/145511  0x0 (nothing)    No       Rx: REGISTER
192.168.90.245   (None)      1f532cc4-11  00101/90300  0x0 (nothing)    No       Rx: REGISTER
192.168.90.243   (None)      c3c2617b-9a  00101/120957  0x0 (nothing)    No       Rx: REGISTER
192.168.90.200   (None)      851e37df-b1  00101/91253  0x0 (nothing)    No       Rx: REGISTER
192.168.90.241   (None)      460d6793-e2  00101/59681  0x0 (nothing)    No       Rx: REGISTER
192.168.90.253   (None)      61ac6850-19  00101/115084  0x0 (nothing)    No       Rx: REGISTER
192.168.90.250   (None)      c443a304-34  00101/57781  0x0 (nothing)    No       Rx: REGISTER
192.168.90.236   106         9687e547-a9  00101/00102  0x0 (nothing)    No       Rx: ACK
192.168.90.232   (None)      ab40d0eb-ab  00101/119700  0x0 (nothing)    No       Rx: REGISTER
192.168.90.236   (None)      3d7c4f93-23  00101/132652  0x0 (nothing)    No       Rx: REGISTER
192.168.90.236   106         0100f4727e8  00103/00104  0x0 (nothing)    Yes      Tx: NOTIFY      Done
192.168.90.248   (None)      d5bca74e-e7  00101/33846  0x0 (nothing)    No       Rx: REGISTER
192.168.90.240   (None)      f1d7bb77-5c  00101/175769  0x0 (nothing)    No       Rx: REGISTER
192.168.90.217   (None)      18de14a5-e5  00101/135925  0x0 (nothing)    No       Rx: REGISTER
192.168.90.238   (None)      a153ee97-5b  00101/211043  0x0 (nothing)    No       Rx: REGISTER

Any ideas?

Sorry, I forgot to answer your question as to what types of phones we are using… they are all Linksys SPA941 or SPA942 IP phones. I have not tried the native * call transfer with # as it appears to be disabled in the current configuration… I see nothing in the dialplan that handles any # digits.