[SR-Users] Redirect server for load balancing and HA

Daniel Tryba d.tryba at pocos.nl
Fri Mar 13 18:45:03 CET 2015


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


-- 

Telefoon: 088 0100 700
Sales: sales at pocos.nl | Service: servicedesk at pocos.nl
http://www.pocos.nl/ | Croy 9c, 5653 LC Eindhoven | Kamer van Koophandel 
17097024




More information about the sr-users mailing list