Transfer dial plan

hello,
I want to ask if its poosible the below senario.
All users use softphones.I want user A to call user B and after user B answer tha call then the call to be automaticaly transfered (maybe through a dial plan) to user C then user A hangup automaticaly and user A talk to User C .Is this possible?

When the calling party ends the call the call really has come to an end. I would go for this scenario in the dial plan:

Set up the call

exten => s,n,Dial(SIP/xxxxxxx/,40,t)

arrange the follow up in the h extensions. This is the extension the dialplan sips to when the call is hangup. Generate a call file in the h extension that calls back to the called party and skips to a context/extension/priority where the next number in line is dialed.

Generating a callfile should like something like (quick and dirty but it is working)
exten => h,n,Set(PAD=/var/spool/asterisk/callfiles/${FILE_NAME})
exten => h,n,System(echo -E “Channel: SIP/xxxxxxxxxx
/${NUMBER_TO_CALL}” > ${PAD})
exten => h,n,System(echo -E “MaxRetries: 5” >> ${PAD})
exten => h,n,System(echo -E “RetryTime: 360” >> ${PAD})
exten => h,n,System(echo -E “WaitTime: 180” >> ${PAD})
exten => h,n,System(echo -E “Context: ${CONTEXT_OF_CHOICE” >> ${PAD})
exten => h,n,System(echo -E “Extension: s” >> ${PAD})
exten => h,n,System(echo -E “Priority: 1” >> ${PAD})
exten => h,n,System(echo -E “SetVar: OUTBOUND_NUMBER=${NEXT_NUMBER_TO_CALL}” >> ${PAD})
exten => h,n,System(echo -E " " >> ${PAD})
exten => h,n,System(echo mv ${PAD} /var/spool/asterisk/outgoing/${COS_FILE_NAME}|at ${AT_VAR})

It all depends on what you really wants. This is a scenario where the calls go in a chain. Start call, hangup and the called party is called back and connected to the next in the chain etc. etc. This is not a working example but I hope it will help you to get the dialplan you have i mind working.

As far as I know You can’t keep the channel of the called party alive when the calling party hangs up.

When the calling party ends the call the call really has come to an end. I would go for this scenario in the dial plan:

Set up the call

exten => s,n,Dial(SIP/xxxxxxx/,40,t)

arrange the follow up in the h extensions. This is the extension the dialplan skips to when the call is hangup. Generate a call file in the h extension that calls back to the called party and skips to a context/extension/priority where the next number in line is dialed.

Generating a callfile should like something like (quick and dirty but it is working)
exten => h,n,Set(PAD=/var/spool/asterisk/callfiles/${FILE_NAME})
exten => h,n,System(echo -E “Channel: SIP/xxxxxxxxxx
/${NUMBER_TO_CALL}” > ${PAD})
exten => h,n,System(echo -E “MaxRetries: 5” >> ${PAD})
exten => h,n,System(echo -E “RetryTime: 360” >> ${PAD})
exten => h,n,System(echo -E “WaitTime: 180” >> ${PAD})
exten => h,n,System(echo -E “Context: ${CONTEXT_OF_CHOICE}” >> ${PAD})
exten => h,n,System(echo -E “Extension: s” >> ${PAD})
exten => h,n,System(echo -E “Priority: 1” >> ${PAD})
exten => h,n,System(echo -E “SetVar: OUTBOUND_NUMBER=${NEXT_NUMBER_TO_CALL}” >> ${PAD})
exten => h,n,System(echo -E " " >> ${PAD})
exten => h,n,System(mv ${PAD} /var/spool/asterisk/outgoing/${COS_FILE_NAME})

It all depends on what you really want. This is a scenario where the calls go in a chain. Start call, hangup and the called party is called back and connected to the next in the chain etc. etc. This is not a working example but I hope it will help you to get the dialplan you have i mind working.

As far as I know You can’t keep the channel of the called party alive when the calling party hangs up.

I am sorry for the very very long reply :smile:. But you were right thans for the answers

1 Like