I’m using Asterisk 1.8.4.2, and I’m trying to Transfer() a call from one Asterisk server to another.
The REFER request comes in, with the correct Refer-To header- showing the correct SIP address to transfer to, but Asterisk gives me an error saying it can’t find that extension (the extension that exists on the remote server), in a local context- which is right- it doesn’t exist locally.
Why is asterisk looking for this extension in a local context, when the Refer-To header clearly points to a remote server?
My setup is like this:
Server A calls server B; server B has a dial plan
s,1,Answer()
s,2,do some stuff over agi
s,3,Transfer(100@c.c.c.c)
So server B sends server A a REFER request to server C, with Refer-To: sip:100@c.c.c.c
Server A receives the REFER request, but then fails with:
Just as a test, I add a local 100 extension on server A under the main context, and it works- but the goal is to transfer to server C, and it seem to just be ignoring the remote IP address of server C.
Asterisk is a back to back user agent, so it normally only looks at the user part and interprets it locally.
However, I believe there is a sip.conf option that tells it, at least for transfers, that it should take account of the domain part, in which case I got the impression from the code that it would generate real outgoing INVITEs.
Please note that the error handling for failed REFERs is fairly broken in 1.6 and I don’t believe it has been fixed in 1.8, although I haven’t checked this.
Yeah- I haven’t been able to find any SIP commands that indicate that they make that work- plus- I went through the source code and- after a quick scan- it looks like the only way the transfer request handling code finishes successfully, is if it’s an attended transfer, or if it finds the extension locally- I don’t see anything in the current code base to suggest that it can send an INVITE out to another machine.
I guess I can do something really hokey and add a local extension that I transfer to, with a dialplan that just does a Dial() out to the real host.
Asterisk 1.8.7.0. Me too facing the same issue even after playing with allowexternaldomains.
However 302 works perfectly with external SIP address when promiscredir is set to yes. @Panic, did you find solution to your problem?