SipML5 to Asterisk

Hello !

I’m using Asterisk 13 and SipML5 as a webRTC phone.
I know that we can retrieve custom data from the webRTC (sipml5) with the dialplan.
If i create a new variable in the javascript of “call.html”. How can i get this variable with the dialplan?

_
_
_

My task is to get custom data from the webRTC sipml5 to my asterisk server. This data will be stock in a .txt as an example.

Any advices will help !
Thanks by advance.
Regard,
NCNN.

The console.log trigger each time i call someone.
I want to insert some javascript there (sipml5 source call.html) to send data from the webrtc to the asterisk. Data that i can stock in a sql database or a .txt

How can i achieve that with the dialplan ? or with the javascript.
Do someone know a good tutorial?

Any advices will help !
Thanks by advance.
Regard,
NCNN.

Information can be sent in a SIP INVITE as a header and then accessed using the PJSIP_HEADER dialplan function[1]. How this is done in your Javascript I have no idea. You could probably also use MESSAGE requests to send information out of a call.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+Function_PJSIP_HEADER

1 Like

@jcolp Thank you for your reply !

After some tests i see that i need to create an INVITE message.
“Gets the specified SIP header from an incoming INVITE message.”

https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Function_SIP_HEADER

With a fresh source of sipML5 i made a call with a custom dialplan to curl data into a php page. I got this :

How can send a custom INVITE message in the javascript of the “call.html” ?
I am a bit lost with the data i receive. on my php.
I’m trying to get sip-headers, but my main goal is to send custom data form my sipML5 webRTC to my asterisk server.

any advices will help !
Regards,
NCNN.

Here is the data i receive on my php with the dialplan

I don’t know what your Javascript is like or how it should be. I’ve given you the Asterisk part, it’s up to you to figure out how to do it on the Javascript side.

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