Summary:ASTERISK-02792: Blind call transfers on SIP channels don't work from within AGI app
Reporter:mdu113 (mdu113)Labels:
Date Opened:2004-11-11 17:16:42.000-0600Date Closed:2011-06-07 14:10:39
Versions:Frequency of
Environment:Attachments:( 0) debug.txt
( 1) sip.conf
( 2) sip.conf.txt
( 3) sipdebug-agi.txt
( 4) sipdebug-dialplan.txt
Description:My dialplan says
I process all calls logic in the script. Starting asterisk 1.0.0 blind call transfers on SIP channels (REFER message) stopped working. The originating channel just being hung up. It does work if I avoid AGI app and launch Dial from dialplan though. This leads me to believe that something is wrong in AGI application.


I'm using Cisco 7960 as SIP endpoints. They are generating REFER SIP message for blind call transfers and this is when this problem showing up. Call transfers by # are  unaffected (if they're allowed, of course). Also such transfers did work in asterisk 0.9.1
Actually I'm not sure where this bug should be filed here or under the SIP section. My guess is it's more AGI application related. Please let me know if it's better to file this bug for SIP channel.
Attached is asterisk debug log.
Comments:By: Brian West (bkw918) 2004-11-11 19:49:58.000-0600

attach a SIP debug please.  


By: Brian West (bkw918) 2004-11-11 19:52:02.000-0600

From that debug it doens't appear you have your sip device registered to your box correctly.


By: mdu113 (mdu113) 2004-11-12 20:54:04.000-0600

Unexpectedly I had a day off today. I'll do it on monday. Sorry for the delay.

By: mdu113 (mdu113) 2004-11-15 11:42:34.000-0600

I've attached 2 debugs: sipdebug-agi.txt is when a Dial called from within AGI script and call transfer didn't work, sipdebug-dialplan.txt is when a Dial called from dialplan and call transfer did work

By: Brian West (bkw918) 2004-11-15 15:17:48.000-0600

post your sip.conf becuase its very clear your SIP devices are NOT registered.


By: mdu113 (mdu113) 2004-11-15 16:16:46.000-0600

testdb*CLI> sip show peers
Name/username    Host            Dyn Nat ACL Mask             Port     Status
xyz_100_2_st2/x  (Unspecified)    D   N  0        Unmonitored
xyz_100_1_st2/x  (Unspecified)    D   N  0        Unmonitored
121281212070000    D   N  1290     Unmonitored
121281212072100    D   N  1290     Unmonitored
121281212070110    D   N  1290     Unmonitored
121281212070100    D   N  1290     Unmonitored
121281212070100    D   N  1290     Unmonitored
12125551122/121  (Unspecified)    D   N  0        Unmonitored
121281212080028  (Unspecified)    D   N  0        Unmonitored
121281212080028  (Unspecified)    D   N  0        Unmonitored
121281212085555  (Unspecified)    D   N  0        Unmonitored

All registered extensions are on the same Cisco 7960. I'm trying to blind transfer from one to another line on the same phone. Also I don't understand how it would work at all if extensions not registered while it does work if AGI isn't used. The problem is AGI script isn't called again for the new (transferred) call.
Here's also extensions.conf:



include => default

exten => _X.,1,Wait(1)
exten => _X.,2,AbsoluteTimeout(0)
exten => _X.,3,DeadAGI(callprocessing.agi)
exten => _X.,4,HangUp()

By: Brian West (bkw918) 2004-11-15 16:55:19.000-0600

I don't think its a sip problem since you can't do SIP blind transfers (or what SIP calls a blind transfer) from an AGI.  SO I suspect this is your AGI that might be at fault.. try putting some delays in there.


By: Brian West (bkw918) 2004-11-15 16:57:58.000-0600

The part that REALLY stands out to me is this:

SIP/  <-- What is this and because its not something thats registered with your asterisk box otherwise you would see SIP/username

not SIP/ip.

This is a config/agi issue not a SIP issue.

By: Brian West (bkw918) 2004-11-15 16:58:41.000-0600

SOunds like your dialing PHONE1 running the AGI and transfering back and you want the AGI to run again after its already ran.. Try AGI instead of DeadAGI.


By: mdu113 (mdu113) 2004-11-15 17:51:37.000-0600

SIP/ is a call from another asterisk box.
You're absolutely right. It works if I use AGI instead of DeadAGI. Do you think it's a bug of DeadAGI or this is correct behavior?
The reason I'm using DeadAGI is to be able reliably get DIALSTATUS variable if a caller hang up. With AGI if the caller hang up first the originating channel is often already destroyed by the time script calls get_variable(DIALSTATUS) and function just returns nothing. So I have no way to know the call status.
Do you think there's another way to work around it?
Thanks a lot.

By: Brian West (bkw918) 2004-11-15 18:08:25.000-0600

ok deadagi should be run on the last loop only.. not the first.. dead agi only works on a hungup channel afaik.  Also your other asterisk box is coming in via the general context in sip.conf thus your asterisk box is WIDE OPEN for anyone to send a call to you.  Go secure that.. get the other asterisk box registering properly or use IAX between them.


By: Brian West (bkw918) 2004-11-15 18:08:37.000-0600

This is a config issue.  Not a bug.

By: mdu113 (mdu113) 2004-11-15 18:24:10.000-0600

Reminder sent to bkw918

No, it's not that bad. The script will only allow calls to locally registered extensions if the call comes through default sip context.