[ previous ] [ next ] [ threads ]
 To :  Ganapathi Chidambaram <ganapathi.rj@g...>,Yate mailing list <yate@v...>
 From :  Jamie Gordon <jamie@d...>
 Subject :  Re: [yate] [ YATE 6.0 ] Routing call using PgSQL Stored function
 Date :  Sat, 30 Sep 2017 15:59:33 +0100
actually ... reading my post again, as long as you're not mixing direct 
locations and the nee to use lines, you can do the following:

set the field location to eg:

/fork sip/sip:testuser1@1... sip/sip:testuser2@1.../

so, return 1 row, but with the multiple fork targets set as above

but again, it's hard to include complex extra parameters, as far as i 
know. So an external script maybe the netter way to go.




On 30/09/2017 13:43, Ganapathi Chidambaram wrote:
> Hi
>
> As i used pgsql stored function to route a call to user/group. Whereas 
> i am getting result properly but even though calls are not routing to 
> the user .
>
> find the below mentioned configuration for the same.
>
> register.conf
>
> query=SELECT * FROM route_master('${billid}','${called}','${trace}');
> result=location
>
> Output of PgSQL:
>
> *fieldvalue*
> trace4444407
> callto.1sip/sip:4444407@1...:5060
> dtmfpassfalse
> locationfork
> pbxassisttrue
> copyparamspbxassist,dtmfpass
> tonedetect_outtrue
> callto.1.secureyes
>
> Logs :
>
>  Query for 'db.1' returned 8 rows, 8 affected [0xcbd510]
> Returned true 'database' delay=0.230988
>   thread=0x7f6e54002c10 'Call Router'
>   data=0x7f6e4c006200
>   retval='(null)'
>   param['account'] = 'technobureau_db'
>   param['query'] = 'SELECT * FROM 
> route_master('1506767265-8','4444407','');'
>   param['results'] = 'true'
>   param['handlers'] = 'pgsqldb:100'
>   param['columns'] = '2'
>   param['rows'] = '8'
>   param['affected'] = '8'
>   param['dbtype'] = 'pgsqldb'
> 2017-09-30_17:34:43.806147  Skipping void route #2
> 2017-09-30_17:34:43.806158  Skipping void route #3
> 2017-09-30_17:34:43.806172  Skipping void route #4
> 2017-09-30_17:34:43.806182  Skipping void route #5
> 2017-09-30_17:34:43.806192  Skipping void route #6
> 2017-09-30_17:34:43.806202  Skipping void route #7
> 2017-09-30_17:34:43.806211  Skipping void route #8
>
> *Call.cdr :*
>
> Status :hangup
> Reason : Offline
>
> But actually user logged-in.
>
> Kindly help me out.
>
> Regards,
> Ganapathi
>
>

-- 


Jamie Gordon

Office: +44 (0)330 3310810
Mobile: +44 (0)781 7639737
http://www.digitallines.net



Digital Lines Limited's registered office is Snappers, Church Road, Rudgeway, Bristol BS35 3SH. Registered in England, number 05293518

***************************************************************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the system manager.





  
    
  
  
    

actually ... reading my post again, as long as you're not mixing direct locations and the nee to use lines, you can do the following:

set the field location to eg:

fork sip/sip:testuser1@1... sip/sip:testuser2@1...

so, return 1 row, but with the multiple fork targets set as above

but again, it's hard to include complex extra parameters, as far as i know. So an external script maybe the netter way to go.




On 30/09/2017 13:43, Ganapathi Chidambaram wrote:
Hi

As i used pgsql stored function to route a call to user/group. Whereas i am getting result properly but even though calls are not routing to the user .

find the below mentioned configuration for the same.

register.conf

query=SELECT * FROM route_master('${billid}','${called}','${trace}');
result=location

Output of PgSQL:

field value
trace 4444407
dtmfpass false
location fork
pbxassist true
copyparams pbxassist,dtmfpass
tonedetect_out true
callto.1.secure yes

Logs :

<pgsqldb:ALL> Query for 'db.1' returned 8 rows, 8 affected [0xcbd510]
Returned true 'database' delay=0.230988
  thread=0x7f6e54002c10 'Call Router'
  data=0x7f6e4c006200
  retval='(null)'
  param['account'] = 'technobureau_db'
  param['query'] = 'SELECT * FROM route_master('1506767265-8','4444407','');'
  param['results'] = 'true'
  param['handlers'] = 'pgsqldb:100'
  param['columns'] = '2'
  param['rows'] = '8'
  param['affected'] = '8'
  param['dbtype'] = 'pgsqldb'
2017-09-30_17:34:43.806147 <register:WARN> Skipping void route #2
2017-09-30_17:34:43.806158 <register:WARN> Skipping void route #3
2017-09-30_17:34:43.806172 <register:WARN> Skipping void route #4
2017-09-30_17:34:43.806182 <register:WARN> Skipping void route #5
2017-09-30_17:34:43.806192 <register:WARN> Skipping void route #6
2017-09-30_17:34:43.806202 <register:WARN> Skipping void route #7
2017-09-30_17:34:43.806211 <register:WARN> Skipping void route #8

Call.cdr :

Status :hangup
Reason : Offline

But actually user logged-in.

Kindly help me out.

Regards,
Ganapathi



-- 


Jamie Gordon

Office: +44 (0)330 3310810
Mobile: +44 (0)781 7639737
http://www.digitallines.net



Digital Lines Limited's registered office is Snappers, Church Road, Rudgeway, Bristol BS35 3SH. Registered in England, number 05293518

***************************************************************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify the system manager.