keywords: ip pbx voip gateway gsm gateway

×

Notice

The forum is in read only mode.
× Questions about G400/G410 Cards.

How to send SIP MESSAGE using chan_extra-1.1.0

12 years 8 months ago #7164 by bluemonster
In asterisk-1.6.2.11/channels/chan_sip.c,the function
static void receive_message(struct sip_pvt *p, struct sip_request *req)
receives SIP MESSAGE method messages and simply drops them.

And I didn't find a send_message function or any other similar things.
Here is my question, how can I send SIP MESSAGE method messages through chan_extra-1.1.0/asterisk-1.6.2.11?

A student from Huazhong University of Science and Technology
12 years 8 months ago #7165 by Joe.Yung
Hi, Do you want to storage these kinds text messages to a file or just print them on the console?
Could you tell us what detail applications would you like ?

i] Last edited by Joe.Yung at 2011-7-28 12:00 [/i

12 years 8 months ago #7166 by bluemonster

Original posted by Joe.Yung at 2011-7-28 11:59

Hi, Do you want to storage these kinds text messages to a file or just print them on the console? Could you tell us what detail applications would you like ?

After receiving a SIP MESSAGE,I want to transmit it to other sip-clients like eyeBean.It's not complex to store these kinds of text messages to a file or print them on the console.In fact,chan_extra-1.1.0 has already print them on the asterisk CLI.The following code comes from function receive_message in chan_sip.c
ast_log(LOG_WARNING, "Received message to %s from %s, dropped it...\n  Content-Type:%s\n  Message: %s\n", get_header(req, "To"), get_header(req, "From"), content_type, buf);
But it's complex to send a SIP MESSAGE from chan_extra-1.1.0.chan_sip.c has some functions named transmit_* like transmit_invite, but getting involved with these functions is really a tough work.Can you give me some easy way to send SIP MESSAGE? Like I can send a SMS by simply executing the command "gsm send sms ..........."

A student from Huazhong University of Science and Technology
12 years 8 months ago #7168 by Joe.Yung
Hello,

According to your requirements, we've downloaded a newer X-lite version which supports for sending instant messages. We placed X-lite as a client, and sent a string "Hello World!" from its text box to asterisk. Asterisk was able to receive the "Hello World!" and print it on the console. But there was no any response on the outside cell phone.

Based on that, we suppose the whole flow as below:


A_ {Client(X-lite)[chan_sip.c]}<
>B_ Asterisk<
>C_ G400P[chan_extra.c]<
>D_ Cell Phone.

According to out test, between stage A and B, no problem. Because we can saw their interactions.

But, it was stopped from B to C. Let alone stage D. Compare to the chan_sip.c, yes, chan_extra,c doesn't have enough functions to match all the SIP functions. It's a huge task.

What kinds of interfaces does your client could provide?

12 years 8 months ago #7207 by bluemonster

Original posted by Joe.Yung at 2011-7-28 16:37

Hello,According to your requirements, we've downloaded a newer X-lite version which supports for sending instant messages. We placed X-lite as a client, and sent a string "Hello World!" from its tex ...

Sorry for replying you so late. Originally, I just want to get the SIP MESSAGE and transmit it to a SIP Client like X-lite(Or linphone or Eyebean). During these days, I have modified chan_sip.c and add some rough code into function receive_message to achieve my goal. The flow you gave above is not my original idea,but if you can bridge chan_sip.c and chan_extra.c,it will bevery exciting.
A_{Client(X-lite)[chan_sip.c]}<-------->B_ Asterisk<--------->C_G400P[chan_extra.c]<-------->D_ Cell Phone.
If chan_sip.c and chan_extra.c are linked together, I think I can then try to make a funny application: A sends a SIP MESSAGE to B, if B is not online, then the message will be sent to B's cellphone as a SMS.

i] Last edited by bluemonster at 2011-8-5 21:39 [/i

A student from Huazhong University of Science and Technology
12 years 8 months ago #7208 by bluemonster
Maybe I used a wrong title.

Chan_extra doesn't handle sip protocol , but Asterisk does. So my question should be "How to send SIP MESSAGE using asterisk-1.6.2.11".

i] Last edited by bluemonster at 2011-8-5 14:15 [/i

A student from Huazhong University of Science and Technology
Time to create page: 0.041 seconds
Powered by Kunena Forum