Hello all,<div><br></div><div>I'm struck with a very strange problem today. I've an AGI with some code subroutine snippet as follows:</div><div><br></div><div><br></div><div><div>sub enable_sbc($) {</div><div> my $carrier = shift;</div>
<div> my $tmp = substr($carrier,1);</div><div> my $jkh = $tmp;</div><div> $server_port = $ast_agi->get_variable("SIPPEER($jkh,port)");</div><div> $ser_ip = $ast_agi->get_variable("SIPPEER($tmp,ip)");</div>
<div> $ast_agi->exec("SIPAddHeader","P-PORT: $server_port");</div><div> $ast_agi->exec("SIPAddHeader","P-IPADDRESS: $ser_ip");</div><div> return 0;</div><div>
}</div></div><div><br></div><div><br></div><div>Where $carrier resolves to "@my-carrier"</div><div><br></div><div>Strangely and very weird get variable is returning correct values on console as given below but the variables containing the values gets lost or confused with each other !</div>
<div><br></div><div><div><SIP/sipproxy3.32-00000000>AGI Rx << GET VARIABLE SIPPEER(my-carrier,port)</div><div><SIP/sipproxy3.32-00000000>AGI Tx >> 200 result=1 (5060)</div><div><SIP/sipproxy3.32-00000000>AGI Rx << GET VARIABLE SIPPEER(my-carrier,ip)</div>
<div><SIP/sipproxy3.32-00000000>AGI Tx >> 200 result=1 (192.168.2.19)</div><div><SIP/sipproxy3.32-00000000>AGI Rx << EXEC SIPAddHeader "P-PORT: "</div><div> -- AGI Script Executing Application: (SIPAddHeader) Options: (P-PORT: )</div>
<div><SIP/sipproxy3.32-00000000>AGI Tx >> 200 result=0</div><div><SIP/sipproxy3.32-00000000>AGI Rx << EXEC SIPAddHeader "P-IPADDRESS: 5060"</div><div> -- AGI Script Executing Application: (SIPAddHeader) Options: (P-IPADDRESS: 5060)</div>
<div><SIP/sipproxy3.32-00000000>AGI Tx >> 200 result=0</div></div><div><br></div><div><br></div><div>Anyone please help. Am I doing anything wrong ?</div><div><br></div><div><br></div><div>Regards,</div><div>Sammy.</div>
<div><br></div><div><br></div>