<div dir="ltr"><div>Just for others looking later, here is the final code I came up with, with rtp_payload extracted. <br></div><div class="gmail_extra"><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote"><div class="gmail_quote"><span class="" style="white-space:pre">                </span>if session:getVariable("switch_r_sdp") ~= nil then</div><div class="gmail_quote"><span class="" style="white-space:pre">                        </span></div><div class="gmail_quote"><span class="" style="white-space:pre">                        </span>local s = '[[' .. session:getVariable("switch_r_sdp") ..']]'</div><div class="gmail_quote"><span class="" style="white-space:pre">        </span></div><div class="gmail_quote"><span class="" style="white-space:pre">                        </span>if string.find(s, "a=rtpmap:(%d+)%stelephone%-event%/8000") ~= nil then</div><div class="gmail_quote"><br></div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>freeswitch.consoleLog("debug", "NO NEED TO START starting spandsp_start_dtmf\n")</div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span></div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>local payload = string.match(s,"a=rtpmap:(%d+)%stelephone%-event%/8000")</div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span></div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>if payload ~= nil then</div><div class="gmail_quote"><span class="" style="white-space:pre">                                        </span>freeswitch.consoleLog("debug", "rtp_payload_number = " .. payload .."\n")</div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>end </div><div class="gmail_quote"><br></div><div class="gmail_quote"><span class="" style="white-space:pre">                        </span>else</div><div class="gmail_quote"><br></div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>freeswitch.consoleLog("info", "starting spandsp_start_dtmf\n")</div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>session:execute("spandsp_start_dtmf")</div><div class="gmail_quote"><span class="" style="white-space:pre">                                </span>session:sleep(2000)</div><div class="gmail_quote"><span class="" style="white-space:pre">                        </span></div><div class="gmail_quote"><span class="" style="white-space:pre">                        </span>end</div><div class="gmail_quote"><br></div><div class="gmail_quote"><span class="" style="white-space:pre">                </span>end </div></div></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Cheers</div><div class="gmail_quote"><br></div><div class="gmail_quote">Phil</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>