[asterisk-users] How to use 'Transfer' to send calls to another asterisk?

Deepesh D deep.d2010 at gmail.com
Fri Oct 12 04:43:38 CDT 2012


I made these changes in dialplan and it worked. Thanks a lot.

In most of the cases S1, S2 and C1 are in my control. But in some
cases the dialplan of C1 is not in my control. Also in some cases C1
can be any SIP client like a softphone or SIP device, so it wont work
in those case. Is there some way I can get those also working.

On Fri, Oct 12, 2012 at 1:12 AM, Joshua Colp <jcolp at digium.com> wrote:
> Deepesh D wrote:
>>
>> If C1 dials S1 and then S1 dials S2 to transfer the call then S1 still
>> remains in the loop till the call is finished. What I wanted to do is
>> to reduce the number of calls on S1, so as soon as S1 receives a call
>> from C1 it redirects the call to S2 using 'Transfer' application and
>> exits from the loop, the call should now be handled by S2
>
>
> With some crafty configuration you can achieve this using Transfer. With
> promiscredir disabled Asterisk will not follow the SIP URI in the 302
> response sent back as a result of calling Transfer. The call reenters the
> dialplan at the user portion of the URI passed back and executes dialplan as
> normal. By prefixing the user portion with a unique identifier you can write
> dialplan that strips the prefix and then dials out to S2.
>
> Flow being:
>
> C1 executes Dial(SIP/${EXTEN}@S1) (matched using _1NXXNXXXXXX)
> S1 executes Transfer(002${EXTEN}) (matched using _1NXXNXXXXXX)
> C1 executes Dial(SIP/${EXTEN:3}@S2) (matched using _0021NXXNXXXXXX)
>
> So simply:
> C1 calls S1
> S1 decides to send it to S2, but wants to tell C1 to do it directly
> S1 sends back a SIP message saying hey call 00218005551212 instead
> C1 matches the number to the dialplan which explicitly calls out through S2
> S2 receives the call and life is good
>
> * Note: This requires control over both C1 and S1, you can't just do it to
> every random system calling.
>
> If you don't get the finer details of this just experiment with the general
> idea and configuration option I mentioned. It won't hurt.
>
> Cheers,
>
> --
> Joshua Colp
> Digium, Inc. | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> Check us out at:  www.digium.com  & www.asterisk.org
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list