On Friday 13 March 2015 17:14:31 Olle E. Johansson wrote:
I'd love to find out why this is the case. I would have estimated 9 out of 10 people need to fine-tune DTMF + codec settings in Asterisk.
The most common solution I've seen is to have kamailio use 10 different ports and have 10 different matching peers in the Asterisk SIP config to select settings.
Cumbersome, why not just use some custom headers (stored in usr_preferences)?
kamailio stuff: if($avp(src_dtmfmode)!="") { append_hf("X-DTMFMode: $avp(src_dtmfmode)\r\n"); }
asterisk stuff: exten => _[+X].,n,ExecIf($[${LEN(${SIP_HEADER(X-DTMFMode)})} > 0]?SIPDtmfMode(${SIP_HEADER(X-DTMFMode)}))
The other way around is bit more tricky. YOu have to dial using the M option (i'm using AGI instead of RT): M(setdtmftx^".$row['dtmftx'].")
[macro-setdtmftx] exten => s,1,NoOp() exten => s,n,SIPDtmfMode(${ARG1}) exten => s,n,MacroExit