Hi Mr. Marco ,
Hope you are at good health .It’s long time has been passed since we talked . Anyways you are glad to hear that i did what i want. Now i can send email to asterisk through my email client and it also recognize by Asterisk . But here I am facing one little problem and is that, Asterisk didn’t tell the time correctly. And i think it’s because of call timestamp parameter.Because my timestamp and timestamp created by asterisk is different. Actually i am unable to understand the call timestamp of Asterisk. It created 10 digits for timestamp and i don’t know how could i interpret it. I created timestamp from the system date.Can you please tell me how Asterisk made it’s timesatmp and what it means, purport how we read it, what it means and how can i crate it with java.
When i call Asterisk it tells me you received new message on 1st januaury 1970 5:33am. I used java to do all the things. It’s a pure java code and i think this time is from Georgian calender which is default. Any ways here i am posting my files and Asterisk files, you will clearly see the difference between timesatmp parameters(mine and Asterisk) .
And one thing more my Asterisk is not playing the message it only tells that you have a new message in both cases either i send message from email or by phone. So can you tell me why this is happening.
Now i am posting generated file. 1st one is mine then the details of each parameter and then file generated by Asterisk.
;
; Message Information File
;
[message]
origmailbox=220
context=office
macrocontext=
exten=
priority=3
callerchan=
callerid=“Basit”<1789>
origdate=Tue Jan 26 06:00:38 PM PKT 2010
origtime=2010-01-26 18:00:38.709
category=
duration=5
origmailbox mailbox the message belongs to
context the voicemail context, asterisk config dialplan uses “contexts” as configuration items,
macrocontext which context was used to answer the call
exten - usually, why the call was transfered to the voicemail
priority - the priority in the context
callerchan - the incoming channel
callerid who called
origdate date/time of call
origtime call timestamp
category - i think this is for “categorizing” messages in virtual mailboxes, availble through the vmail.cgi application.
duration how long is the message
;
; Message Information file
;
[message]
origmailbox=206 (exist in database)
context=office (exist)
macrocontext=
exten=206 (same as origmailbox)
priority=3 (constant means for every user priority is 3)
callerchan=SIP/208-09fb58c0
callerid=“Bashir” <208> (exist in database)
origdate=Fri Oct 31 08:46:27 PM PKT 2008
origtime=1225467987
category=
duration=2
And here is the code that how i created timestamp with java
import java.sql.Timestamp;
import java.util.Date;
public class OrigTime {
//Method that returns a TimeStamp object
public static Timestamp getCurrentTime(){
//Instiate a Date object and calls the getTime() method, and creates and returns
//the Timestamp object with the current time. In one line
return new Timestamp(new Date().getTime());
}
}
Also tell me one thing that the time is in seconds or milliseconds(duration=2) it is 2 sec. Is it?
Hi brad what you want to do tell me i will tell you everything that i have done so far and also helps you if i am able to do it .Sorry i just saw your message because i was busy in doing this email to asterisk, that’s why i couldn’t respond you that time, in fact even i don’t no when your message came. Anyways again sorry.
Thank you