I will post here the work-around for ringback problems I came up with if anyone else should need it.
To clarify I was not getting ringback when calling from any MGCP device (extension) to any SIP or MGCP device (extension) . SIP to SIP and SIP to MGCP ws not affected.
I created a 2 minute long ringback audio file, and a 30 second busy (engaged) tone audio file.
I created custom music on hold for ringback and another for busy (engaged)
musiconhold.conf
[ringback]
mode=files
directory=/var/lib/asterisk/ringback
[engaged]
mode=files
directory=/var/lib/asterisk/engaged
Since my MGCP devices are extensions 5921 and 5922 and all SIP devices are 590X and 591X I came up with the following
extensions.conf (from-internal in my case)
;fake ringback and busy
; dummy extension rings for 30 seconds while we play busy (engaged) tone
exten => 8888,1,Wait(30)
exten => 8888,2,Hangup()
;MGCP to MGCP dialing
exten => _592X/_592X,1,Dial(MGCP/aaln/${EXTEN:3}@192.168.1.49,,m(ringback))
exten => _592X/_592X,2,Dial(Local/8888@from-internal,,m(engaged))
exten => _592X/_592X,3,Hangup()
;MGCP to SIP dialing
exten => _59[01]X/_592X,1,Dial(SIP/${EXTEN},,m(ringback))
exten => _59[01]X/_592X,2,Dial(Local/8888@from-internal,,m(engaged))
exten => _59[01]X/_592X,3,Hangup()
;Real ringback
;SIP to MGCP
exten => _592X/_59[01]X,1,Dial(MGCP/aaln/${EXTEN:3}@192.168.1.49)
exten => _592X/_59[01]X,2,Hangup()
;SIP to SIP
exten => _59[01]X/_59[01]X,1,Dial(SIP/${EXTEN},,Tr)
exten => _59[01]X/_59[01]X,2,Hangup()
Of course you can modify the above to accomodate voice mail.