Pjsip send sms like

I am trying to send sms messages via pjsip without luck.

The account is registered on the server, and I get a response about the successful registration, but I can not find any good tutorials that show how to send SMS.

I found this book on the Internet, but it still does not give me any examples of how to use this library: http://www.scribd.com/doc/90092246/Pjsip-Dev-Guide#outer_page_48

I know that I should use:

pjsip_endpt_create_request(pjsip_endpoint *endpt, const pjsip_method method, const pj_str_t *target, const pj_str_t *from, const pj_str_t *to, , const pj_str_t *call_id, int cseq, const pj_str_t *text, pjsip_tx_data **p_tdata); pjsip_endpt_acquire_transport(pjsip_endpoint *endpt, pjsip_transport_type_e type, const pj_sockaddr_t *remote, int addr_len, const pjsip_tpselector *sel, pjsip_transport **p_tp) 

but other than that, I have no idea.

Note. I do not want instant messaging, I want texts to be delivered as SMS, if possible. And this needs to be done in pjsip, no other library (unfortunately, there is no flexibility).

Thanks in advance!

+7
source share
2 answers

Ok, here again I answer my question related to pjsip. I want this library to have proper documentation where function calls are explained in the best way they work.

One thing that confused me was that in this developer guide: http://www.pjsip.org/release/0.5.4/PJSIP-Dev-Guide.pdf

There are 2 topics. 1 - these are message elements and how to create a request. Another is instant messaging. I was not exactly sure what is required for SMS. Turns out it's instant messaging.

The only required function:

 pjsua_im_send(pjsua_acc_id acc_id, const pj_str_t *to, const pj_str_t *mime_type, const pj_str_t *content, const pjsua_msg_data *msg_data, void *user_data); 

The 1st variable acc_id is what is initialized at the beginning of SIP application registration.

The second variable is the number to which you want to send the message. I initialized it as such:

 "sip: 16476804556@sipserverdomain.com " 

The third variable is for sending MIME. I have not used this. so this is NULL.

The fourth variable is the body of the message.

For example:

 pj_str_t text; const char *msgText = [@"Hello there!" UTF8String]; text = pj_str((char*)msgText); 

then I passed: &text function.

The fifth variable is msg data. Again, he did not use it. This is NULL.

6th - user data. I did not use this either. NULL

And finally, the function call looked like this:

  pjsua_im_send(app._sip_acc_id, &to, NULL, &text, NULL, NULL); 

Hope this helps someone who has a similar problem! -c0d3Junk13

+12
source

SMS is essentially an email sent to phonenumber@serviceprovider.com. I did not use pjsip, however I was able to use the Chilkat library to deliver SMS quite easily. For example, a code to send an email, you can find it on your website.

+4
source

All Articles