[asterisk-users] Call diversion

Michele Pinassi michele.pinassi at unisi.it
Wed Oct 14 04:56:24 CDT 2015

Hi all,

i'm trying to setup a function like "secretary/director": when an user
call director number (eg. 5000), the call were firstly diverted to
secretary (5001). At this point, when secretary answer, can decide to
transfer back the call to director (5000).

Because i'm using OpenSIPS as SIP router, when this function is needed i
did a special "extension" like DIVERT_[from]_[to]:

exten => _DIVERT_.,1,Noop("from-voip: DIVERT ${CALLERID(num)} -
${EXTEN}") ; Example: DIVERT_5000_5001
exten => _DIVERT_.,n,Set(DIVFrom=${CUT(EXTEN,_,2)})
exten => _DIVERT_.,n,Set(DIVTo=${CUT(EXTEN,_,3)})
exten => _DIVERT_.,n,Noop("Divert ${CALLERID(num)} from ${DIVFrom} to
exten => _DIVERT_.,n,Macro(services-divert) // Divert
exten => _DIVERT_.,n,Hangup()

and a macro like:

[macro-services-divert] ; Servizio direttore-segretaria
exten => s,1,Noop("Divert from ${CALLERID(num)}")
same  => n,Answer
same  => n,Playback(msg/msg_attendereufficiodesiderato)
same  => n,Dial(SIP/voip-trunk/${DIVTo},30)

It works *BUT* when from the secretary phone the call were forwarded
back to director (and, at this point, director phone must ring !), the
call stall with an error on OpenSIPS like:

In-Dialog NOTIFY from [my asterisk box ip]
(callid=707902a659eb005b141a9491195bd3cf at voip) is not valid according to

Any hits ?


Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - centralino at unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di Ateneo, http://www.faq.unisi.it 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20151014/f1081259/attachment.pgp>

More information about the asterisk-users mailing list