0

my sip partner does send sometimes in SDP:

v=0
o=HuaweiSoftx3000 69494235717543 69494235717543 IN IP4 18.8.14.12
s=-
c=IN IP4 18.8.14.12
t=0 0
m=audio 39204 RTP/AVP 96 98 8 99 100 104 0 97
a=rtpmap:96 AMR-WB/16000
a=rtpmap:8 PCMA/8000
a=rtpmap:104 telephone-event/16000

(there is no telephone-event/16000), we do expect a telephone-event/8000 so we change it (simply a text replace)

so we fix it - like this

route[FIXSDP] {
       if (has_body("application/sdp")) {
               if(subst("/event\/16000/event\/8000/")) {
                       xlog("L_INFO", "SDP SILLTFIXDTMF [$fU->$tU]");
               }
       }
}

it's about 20% of sip traffic.

but we want (need) to replace a 8000 coming back to this party in '200' messages to look like 16000, and only in those dialogs (other have a 8000 and work fine), any hints? (need to be stateful with this).

2 Answers2

0

You should check textops module, it have many rewrite functions.

For backwards you should use on_reply route. You may mark your calls using dialog and avpairs.

arheops
  • 15,544
  • 1
  • 21
  • 27
0

You can use Kamailio htable module.

modparam("htable", "htable", "telEvent=>size=1024;autoexpire=10800")
$sht(telEvent=>$ci::status) = 1;

When special packet is arrived, you can add this info to htable. Then you can use it while sending 200 OK packet.

uyalap
  • 11
  • 2