Send SMS from pjsip endpoint to mobile through Goip

earlier i was able to receive an SMS sent from a mobile to a pjsip endpoint through my goip where i assigned that SMS from gsm to voip shall be passed to 37200(which is my endpoint)
i used MESSAGESEND APPLICATION in order to do this.

exten => _X.,1,NoOp({EXTEN:0})** **same => n,noop("message")** **same => n,noop({MESSAGE(body)})
same => n,Messagesend(pjsip:37200,${MESSAGE(body):1:11})

successfull !!!

now i was trying to send an SMS from my 37200 (pjsip endpoint) to the gsm mobile through goip. so i was trying to send the SMS just like the way i can reach this mobile by dialing from 37200 (which i did successfully) but the SMS was not sent.

here is how i call my gsm mobile from 37200:
exten => _03164891.,1,NoOp()
same => n,Dial(PJSIP/${EXTEN}@gsmgateway,25)
same => n,Hangup()

and here is how i was trying to send the SMS which failed !
same => n,Messagesend(pjsip:03164891@gsmgateway,${MESSAGE(body)})

and here is the output :
[Jul 23 14:39:21] ERROR[22726]: res_pjsip_messaging.c:654 msg_send: PJSIP MESSAGE - Could not find endpoint ‘sip:03164891@gsmgateway’ and no default outbound endpoint configured


so i could not figure out the problem yet ! is it because of the numbering ! i mean in order to send the SMS then the numbering is different than while trying to make a call !
or is it because i need to do some extra configurations at the goip ! something like sms server or whatever ! or do i need to use some other application than messagesend … i am stuck here and i have no idea on what should be done …

Actually, the question should be why did the Dial work!

As I understand it, one always needs to provide an endpoint, even if it is just a dummy one for direct use of URIs.

The end point does exist !
When i dial it it is referred as PJSIP/03164891@gsmgateway … it is fine.

But when i want to send an sms to it then itshould be referred as pjsip:number … and this is not working … may be because i cannot send a message to that gateway without doing extra things or maybe i dunno i should use another app !

One way or another, you need to provide gsmgateway, as well as the URI.

I did make a mistake in saying that this format:

exten => _9NXXNXXXXXX, 1 ,Dial(PJSIP/${EXTEN: 1 } @mytrunk )

wasn’t valid, but the format you actually need is:

exten => _9NXXNXXXXXX, 1 ,Dial(PJSIP/mytrunk/sip:${EXTEN: 1 } @203 .0. 113.1 : 5060 )

Examples taken from https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels

Well actually i have no problems with this format and it is working fine but big thanks for the extra info about it …
The problem i am facing is with sending an sms to this gsm gateway through my goip

Thanks in advance

I guess this wont work, I was able to send SMS from the GOIP but using curl commad to query the GOIP SMS script page

Also nice to know it is posible to receive SMS directly on the endpoint

1 Like

Could you please afford more details ?
Is there a tutorial about doing it ?

I would be grateful if you can help
Thanks in advance

1 Like

Thank you
So as i understood that this script allows the goip to send sms right !?

But i still have to do something to make the pjsip endpoint send this sms through the goip, true ?

I am still trying to understand what this script do …
And to be honest i am not familiar with it so i dont really know where to pass the script to make it function …

I would appreciate more details …

And if this script allows sending sms from pjsip endpoint through goip (not from goip it self) … then what should i do at extensions.conf file ? But i think it only allows sending the message from the goip …

Anw thanks a lot

Script quetions need to be asked to the developer of the script

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.