[OpenSER-Users] a c program behaves differently when called by openser than it does when called from the console.

Daniel-Constantin Mierla daniel at voice-system.ro
Fri Jul 13 13:02:42 CEST 2007


Hello,

On 07/11/07 14:08, Bontron wrote:
> Hello,
>
> I have this piece of code in my openser.cfg :
> exec_msg("/usr/local/etc/openser/uri-folder/record '$fu' $$SIP_USER '$ft'
> 'additionalinfo'");
> The instruction 'record' is a c program.
>
> This is supposed to add a record in a mysql database  - new incoming call,
> from caller , to called, date, and an additional info - and as the matter of
> fact it almost does except that 'record' is unable to append the date. It
> writes  '0000-00-00'.
>
> The strange thing is that when the 'record' instruction is being called from
> the console, the set of instructions being manually written : record
> 'joe at ....' etc ... it records everything including the right date and time.
>
> Did any one face a similar situation ? Thanks in advance.
>   
I do not know how you get the date there, but if you rely on some 
environment varibles, beware that openser fakes the environment when 
executing the command. You may use date functions from the mysql.

As side not, have a look at avp_db_query(), you may achieve same 
functionality without the need of calling external commands.

Cheers,
Daniel

> Olivier
>
>
> ________________________________________________
> Message sent using UebiMiau 2.7.8
>
>
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the Users mailing list