[ previous ] [ next ] [ threads ]
 To :  "'Marian Podgoreanu'" <marian@v...>
 From :  "Andrew Checkov" <expert@a...>
 Subject :  RE: [yate] SS7 cal routing at external script
 Date :  Wed, 14 Apr 2010 13:01:41 +0400
Example of working PHP code which reroutes inbound call from SS7 to SS7 with
setting some specific SS7 signaling options for both outbound IAM and
inbound ACM

switch ($ev->name) {

case "call.route":

if ( ($ev->params["module"] == "sig") && 
	($ev->params["isup.message-type"] == "IAM")) {

# outbound trunk
$ev->SetParam("link","link1");

# SS7 signaling options for inbound call (ACM)
$ev->SetParam("message-oprefix","osig.");
$ev->SetParam("osig.BackwardCallIndicators", 
	"charge,called-free,called-ordinary,isup-path,isdn-end,echodev");

# SS7 signaling options for outbound call (IAM)
$ev->SetParam("sig.ForwardCallIndicators", 
	"international,isdn-orig,isup-path");
$ev->SetParam("sig.callerscreening", "user-provided-passed");
$ev->SetParam("sig.TransmissionMediumRequirement", "3.1khz-audio");
$ev->SetParam("sig.inn", "false");

# rewrite caller
$ev->SetParam("caller", "74959800321");

# forward call to another number
$ev->retval = "sig/74957756030.";
$ev->handled = true;
}

break;


> -----Original Message-----
> From: Marian Podgoreanu [mailto:marian@v...]
> Sent: Wednesday, April 14, 2010 11:35
> To: Andrew Checkov
> Cc: yate@v...
> Subject: Re: [yate] SS7 cal routing at external script
> 
> Hi
> 
> You must set the message parameters explicitly and set the call target in
> message's return value:
> 
> $ev->SetParam("message-oprefix","osig.");
> ...
> $ev->SetParam("link","link1");
> $ev->retval = "sig/74957756030.";
> 
> Marian
> 
> Andrew Checkov wrote:
> > Hi,
> >
> > Could you please advice how to route inbound SS7 call to SS7 trunk at
> > external PHP script?
> >
> > Here's my config #1:
> >
> > 1. Routing is made at regexroute.conf
> >
> > ${module}^sig$=;message-oprefix=osig.
> > ${module}^sig$=;osig.BackwardCallIndicators=charge,called-free,called-
> ordina
> > ry,isup-path,isdn-end,echodev
> > ${module}^sig$=sip/sip:74957756030@8...
> >
> > This works - call is routed from sig to sip.
> >
> > 2. Routing is made at external script
> >
> > case "call.route":
> > 	if ( ($ev->params["module"] == "sig") &&
> > ($ev->params["isup.message-type"] == "IAM")) {
> > 		$optsi =
> > "message-oprefix=osig.:osig.BackwardCallIndicators=charge,called-
> free,called
> > -ordinary,isup-path,isdn-end,echodev";
> > 		$ev->retval = "sip/sip:74957756030@8...;" .
> > $optsi;
> > 		$ev->handled = true;
> > 	}
> > 	break;
> >
> > This works - call is routed from sig to sip - the same as with
> > regexroute.conf
> >
> >
> > Here's my config #2:
> >
> > 1. Routing is made at regexroute.conf
> >
> > ${module}^sig$=;message-oprefix=osig.
> > ${module}^sig$=;osig.BackwardCallIndicators=charge,called-free,called-
> ordina
> > ry,isup-path,isdn-end,echodev
> > ${module}^sig$=sig/74957756030.; link = link1;
> >
> > This works - call is routed from sig to sig.
> >
> > 2. Routing is made at external script
> >
> > case "call.route":
> > 	if ( ($ev->params["module"] == "sig") &&
> > ($ev->params["isup.message-type"] == "IAM")) {
> > 		$optsi =
> > "message-oprefix=osig.:osig.BackwardCallIndicators=charge,called-
> free,called
> > -ordinary,isup-path,isdn-end,echodev";
> > 		$ev->retval = "sig/74957756030.;link=link1;" . $optsi;
> > 		$ev->handled = true;
> > 	}
> > 	break;
> >
> > This doesn't work with the following debug:
> >
> >  Signalling call failed. No trunk specified
> >  Call hangup. Reason: 'noconn' [0xb69020c8]
> >  Sending message (0x9d78ba8)
> >
> >
> > Regards,
> > Andrew Checkov